Resources Numerical accuracy
Calculations
Every calculation under our calculation policies: what it works out, its formula and the precision it runs at. Open one to see its code as it is in the released app.
Calculations
-
Rounding of the solved value
Replaces the solved value by the roundest number near it that still solves the equation.
first of round(x, d decimals) for d = 0…10, then x to 12 significant digits, that keeps |f| within tolerance; else x
Parameters and equations params.js64-bit- CadCraft
- PartCraft
-
Edited dimension written back to a parameter
When a driven value is edited, changes the driving parameter behind its equation, or rewrites a constant equation to the new number.
Parameters and equations params.js64-bit- CadCraft
- PartCraft
-
Value typed for a parameter
Sets a driving parameter to a typed value, or solves the driving parameter behind a driven one.
Parameters and equations params.js64-bit- CadCraft
- PartCraft
-
Removing a parameter and writing its value in
Removes a parameter and, when asked, writes its current value into every expression that used it.
Parameters and equations params.js64-bit- CadCraft
- PartCraft
-
Design table row made permanent
Writes a set of override values into the parameters.
Parameters and equations params.js64-bit- CadCraft
- PartCraft
-
Rule read into the library
Checks a rule from a file or from storage and sets the base size's move to zero.
Grade rule library addons/apparel/lib/rules.js64-bit- CadCraft
-
Rule applied to a piece
A library rule as moves for a piece's own size range and units.
move = round to 6 decimals of (m − base) × k; k = 1, 25.4 or 1 ÷ 25.4
Grade rule library addons/apparel/lib/rules.js64-bit- CadCraft
-
Rules read from a RUL file
Turns a RUL file's rules into library entries measured from the sample size.
move = value for the size − value for the sample size
Grade rule library addons/apparel/lib/rules.js64-bit- CadCraft
-
Rules written to a RUL file
Writes the library's rules as the delta lines of a RUL file.
Grade rule library addons/apparel/lib/rules.js64-bit- CadCraft
-
Face-frame default sizes
The stile and rail width, overlay and door gap a job uses when it sets none.
stile = rail = 38 mm; overlay = 12 mm; gap = 3 mm; inch job: round(mm ÷ 25.4 × 16) ÷ 16
CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Carcass depth behind a face frame
The depth the carcass is built with when a face frame takes part of the cabinet's depth.
d = max(1, d − frame thickness)
CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Face-frame openings and overlay fronts
The rails, the openings between them and the doors or drawer fronts that cover each opening.
opening h = (box h − (2 + mids) × rail) ÷ (mids + 1); front h = opening h + lap below + lap above; pair door w = (opening w + 2 × overlay − gap) ÷ 2
CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Door and blind panel of a blind corner
The door over the open part of a blind corner cabinet and the panel over the blind part.
door w = (w − blind) − reveal; panel w = blind − reveal; h = box h − reveal
CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Part size stored in the cut list
Adds one part with its length, width, thickness and material.
CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Frame rail length and counts
The length of the frame's rails and how many rails and mid rails a cabinet needs.
rail length = w − 2 × stile − blind
CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Doors and drawer fronts counted by size
Groups equal fronts into one cut-list line with a quantity.
CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.jsExact- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Drawer boxes of a face-frame cabinet
The sides, ends and bottom of each drawer box behind a face frame.
box h = min(front h − clearance, opening h − 20 mm); end = bw − 2t; bottom = (bw − 2t + 2g) × (slide − 2t + 2g); bw = opening w − 2 × slide gap
CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Dowels of a corner cabinet
The number of dowels a corner cabinet's drilling needs.
dowels = dowel holes ÷ 2
CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Curved cabinet outline in the cell's own axes
The outline points of a made-to-order curved cabinet, measured from the cell's origin along its two axes.
(x′, y′) = ((q − o) · u, (q − o) · n)
CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Closing panel of an angled corner
The height of the panel that closes a corner which is not a right angle.
height = cabinet h − plinth height
CabinetCraft parts, fronts and face frames addons/cabinetcraft/lib/build.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Job converted to the other unit
Every size in the job converted from millimeters to inches or back when the job's unit is changed.
to inches: round(v × (1 ÷ 25.4) × 16) ÷ 16; to millimeters: round(v × 25.4)
Cabinet job edits that change sizes addons/cabinetcraft/lib/edit.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Gap at a door or window
The width of the gap put in a run's floor row so that the cabinets after it clear an opening.
width = ⌈(at + w + clear − start) × 10⌉ ÷ 10
Cabinet job edits that change sizes addons/cabinetcraft/lib/edit.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Filler for a leftover
Adds a filler as wide as the space a row leaves on its wall.
filler width = rest, when 0.5 < rest ≤ 75 mm
Cabinet job edits that change sizes addons/cabinetcraft/lib/edit.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Notch of a new L or U room
The first size of the notch when a rectangular room is made L or U shaped.
notch width = round(W ÷ 3); notch depth = round(D ÷ 2)
Cabinet job edits that change sizes addons/cabinetcraft/lib/edit.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Cables and their routes
One cable per circuit with its route length, plus the fill of every tray and conduit it runs in.
point in mm = plan point × (meters per unit × 1000); cable route = the longest of the board-to-device routes
Cable routes in trays and conduits on the installation plan addons/electrical/lib/carriers.js64-bit- CadCraft
-
Fill rows for the list
The rows of the tray and conduit fill list, with the fill percentage and whether it is within the limit.
pct = round(fill % × 10) ÷ 10
Cable routes in trays and conduits on the installation plan addons/electrical/lib/carriers.js64-bit- CadCraft
-
Tray size in the layer name
The layer name that records what a route is: a tray of a width and depth, or a conduit of a type and trade size.
EL-ROUTE-TRAY-round(width)Xround(depth)
Cable routes in trays and conduits on the installation plan addons/electrical/lib/carriers.js64-bit- CadCraft
-
Harness segment lengths
The length in millimeters of each drawn harness segment.
len = √(Δx² + Δy²) ÷ k (k = drawing units per mm), unless a length is typed
Wire lengths through a harness or a cabinet addons/harness/lib/route.js64-bit- CadCraft
-
Shortest route between two nodes
The segments a wire runs through and their total length.
len = Σ segment lengths along the shortest path
Wire lengths through a harness or a cabinet addons/harness/lib/route.js64-bit- CadCraft
-
Bundle diameter
The diameter of a bundle of wires from their outside diameters.
D = √(Σ dᵢ² ÷ packing)
Wire lengths through a harness or a cabinet addons/harness/lib/route.js64-bit- CadCraft
-
Cut length of each wire
Each wire's length with its end allowances, and which wires share each harness segment.
harness: route + 2 × allow + loop; cabinet: (|Δx| + |Δy|) × slack + 2 × allow + loop
Wire lengths through a harness or a cabinet addons/harness/lib/route.js64-bit- CadCraft
-
Fixture positions for the calculation
Each fixture's position in millimeters, its height and its aim, as the engine reads them.
p = (x ÷ k, y ÷ k, height)
Illuminance values written on the lighting plot addons/lighting/lib/lux.js64-bit- CadCraft
-
Lux written at the grid points
The text objects that show the illuminance at each grid point in the drawing.
text = round(E); position = grid point × k
Illuminance values written on the lighting plot addons/lighting/lib/lux.js64-bit- CadCraft
-
Pieces from quantities
One entry per piece to cut, from rows with a quantity.
Cutting profile pieces from stock bars addons/windows/lib/cutlist/bars.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Length a bar takes
The length of bar used by a set of pieces, with the saw kerf and the saving when mitred ends share a cut.
used = Σ (length + kerf) − depth × min(⌊mitred ends ÷ 2⌋, mitred pieces − 1)
Cutting profile pieces from stock bars addons/windows/lib/cutlist/bars.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Fewest bars for one stock length
Which pieces go on which bar, and whether the count is proven to be the fewest.
bound = ⌈Σ (length + kerf) ÷ usable − 1e-9⌉; usable = stock − trim at both ends
Cutting profile pieces from stock bars addons/windows/lib/cutlist/bars.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Bars, cut positions, offcuts and waste
The list of bars with each piece's start position, the offcut left on each bar and the totals.
pos accumulates length + kerf; offcut = stock − trims − used; waste % = round((1 − piece length ÷ stock length) × 10⁴) ÷ 100
Cutting profile pieces from stock bars addons/windows/lib/cutlist/bars.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Totals over all profiles
The number of bars, the piece length, the stock length and the waste over every profile and color.
waste = Σ stock length − Σ piece length
Cutting profile pieces from stock bars addons/windows/lib/cutlist/bars.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Lineweight to stored index
The index written for a lineweight, or the codes for by layer, by block and default.
index of the list value with the smallest |value − lineweight|
Lineweights in a DWG file dwg/model.jsExact- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
-
Stored index to lineweight
The lineweight for an index read from a file.
Lineweights in a DWG file dwg/model.jsExact- CadCraft
- BimCraft
- ModelCraft
- TakeoffCraft
- CivilCraft
-
Longest clear part of a move
The part of a straight move that stays clear of other solids.
steps = min(160, max(4, ⌈|δ| ÷ (thin ÷ 2)⌉)); then 24 halvings between the last clear and the first blocked sample
Where a moved solid stops against another m3d/collide.js64-bit- CadCraft
- ModelCraft
-
Thinnest dimension
The smallest box side of the moving pieces and of everything in the way, which sets the sample spacing.
thin = max(0.005, min over boxes of the smallest side above 1e-4)
Where a moved solid stops against another m3d/collide.js64-bit- CadCraft
- ModelCraft
-
Edge through the inside of a face
Whether a segment passes through a face's interior.
sₚ = n·p − d, s_q = n·q − d; t = sₚ ÷ (sₚ − s_q)
Where a moved solid stops against another m3d/collide.js64-bit- CadCraft
- ModelCraft
-
Point in a face
Whether a point on a face's plane lies in one of its triangles.
u, v from cross products ÷ |n|²; inside when u, v, 1 − u − v ≥ −1e-9
Where a moved solid stops against another m3d/collide.js64-bit- CadCraft
- ModelCraft
-
Point inside a solid
Whether a point lies inside the closed surface made of an object's faces.
Where a moved solid stops against another m3d/collide.js64-bit- CadCraft
- ModelCraft
-
Ray against a triangle
The distance along a ray to a triangle, or nothing when it misses.
det = e₁·(d × e₂); u = (s·(d × e₂)) ÷ det; v = (d·(s × e₁)) ÷ det; t = (e₂·(s × e₁)) ÷ det
Where a moved solid stops against another m3d/collide.js64-bit- CadCraft
- ModelCraft
-
Box of a placed component
The bounding box in the model of a component's faces and edges, from its own coordinates and its placement matrix.
X = (m₀x + m₄y + m₈z + m₁₂) ÷ w
Where a moved solid stops against another m3d/collide.js64-bit- CadCraft
- ModelCraft
-
Monod growth in a batch or fed-batch vessel
Concentrations of biomass, substrate and product, the volume, and their masses at each output time.
μ = μmax × S ÷ (Ks + S); dX/dt = (μ − kd) X − D X; dS/dt = −(μ ÷ Yxs + m) X + D (Sf − S); dP/dt = (α μ + β) X − D P; dV/dt = F; D = F ÷ V
Fermentation (Monod kinetics) process/batch.js64-bit- CadCraft
- BimCraft
-
Lower and higher heating value
The heat released by burning one mole of a component, with the water formed as vapor or as liquid.
LHV = h_f − n_C × h_f(CO2) − (n_H ÷ 2) × h_f(H2O gas); HHV uses h_f(H2O liquid)
Process emissions (CO2 equivalent) process/emissions.js64-bit- CadCraft
- BimCraft
-
Complete combustion of a stream
The CO2 and water produced, the oxygen needed and the heat released when a stream is burned.
CO2 = Σ nᵢ × Cᵢ; H2O = Σ nᵢ × Hᵢ ÷ 2; O2 = Σ nᵢ × (Cᵢ + Hᵢ ÷ 4 − Oᵢ ÷ 2); kg CO2 = CO2 × 0.04401
Process emissions (CO2 equivalent) process/emissions.js64-bit- CadCraft
- BimCraft
A calculation is added only after its source was read. Each statement can be checked in the code shown on its policy's page; the app repositories are public. When a release changes a calculation, its page says so until it has been read again.