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
-
Width and height in pixels
The pixel size of the picture.
h = round(w × vh ÷ vw); k = min(1, MAX ÷ w, MAX ÷ h)
Rendered picture size render-tools.js64-bit- BimCraft
-
Value and time of one reading
A single reading of a feed with its time.
t = tt × 1000 if tt < 1e11, else tt
Live feed values and times assets-bim-live.js64-bit- BimCraft
-
Outside diameter handed to the router
The pipe's outside diameter in millimeters for a route between two ports.
od = od in × 25.4
Pipe route clearance size addons/plant/main.js64-bit- BimCraft
-
Rounding to one and two decimals
Rounds a value for a message or for a warning's stored fields.
f1(x) = round(10 x) ÷ 10; f2(x) = round(100 x) ÷ 100
MEP check messages: units and rounding mep/problems-mep.js64-bit- BimCraft
-
Pipe flow and velocity in the message
Shows a flow in gallons per minute or liters per second and a velocity in feet or meters per second.
gpm = q ÷ 0.003785411784 × 60; L/s = 1000 q; ft/s = v ÷ 0.3048
MEP check messages: units and rounding mep/problems-mep.js64-bit- BimCraft
-
Stored velocity and pressure values
Writes the required and found velocity and the pressure left at a fixture into each pipe warning.
found = f2(V) m/s; required = f2(v_max) m/s; pressure = f1(kPa)
MEP check messages: units and rounding mep/problems-mep.js64-bit- BimCraft
-
Duct velocity, friction rate and aspect ratio
Writes a duct's flow, velocity, needed round size and aspect ratio into its warning.
fpm = round(V ÷ 0.00508); L/s = f1(1000 q); needed size = round(mm)
MEP check messages: units and rounding mep/problems-mep.js64-bit- BimCraft
-
Tube dimensions for a size
The outside, wall and inside dimensions of one tube, in inches and millimeters.
id = od − 2 × wall; odMm = round(od × 25.4 × 1000) ÷ 1000; wallMm = wall × 25.4
Refrigeration copper tube sizes mep/tables-acr.js64-bit- BimCraft
-
Placements from the modifier stack
The list of placement matrices for the source, first the original.
stepₖ = (hiₖ − loₖ) × relₖ + absₖ; Mᵢ = translate(i × step) × M
Group modifiers: scale and array placements group-mods.js64-bit- ModelCraft
-
Number of copies
How many placements the enabled Array items make together.
copies = Π countᵢ
Group modifiers: scale and array placements group-mods.jsExact- ModelCraft
-
Size of a loose piece
Decides whether a separate piece is small enough to remove.
max(Δx, Δy, Δz) < minSize
3D-print mesh repair print-repair.js64-bit- ModelCraft
-
Middle point of a filled hole
The new vertex a hole's fan of triangles meets at.
c = Σ pᵢ ÷ n
3D-print mesh repair print-repair.js64-bit- ModelCraft
-
Signed volume and inside-out pieces
Finds closed pieces that face inward and turns them outward.
V = Σ a · (b × c) ÷ 6; turned when V < 0 and the piece is not inside another
3D-print mesh repair print-repair.js64-bit- ModelCraft
-
Ray and triangle
Where a ray meets a triangle, for the inside test.
det = e₁ · (d × e₂); u = (s · h) ÷ det; v = (d · q) ÷ det; t = (e₂ · q) ÷ det
3D-print mesh repair print-repair.js64-bit- ModelCraft
-
Delaunay triangulation
Triangles over a set of points in plan.
D = 2 (aₓ(b_y − c_y) + bₓ(c_y − a_y) + cₓ(a_y − b_y)); center = (Σ |p|² × Δ) ÷ D; inside when |p − center|² < r² (1 − 10⁻¹²)
Terrain from contours and terrain grids terrain.js64-bit- ModelCraft
-
Terrain from contour edges
Collects the contour points, merges close ones and triangulates them.
key = round(100 x), round(100 y); thinning step = n ÷ 8000
Terrain from contours and terrain grids terrain.js64-bit- ModelCraft
-
Terrain grid
A flat grid of triangles of a given width, depth and spacing.
nₓ = round(width ÷ spacing), 1…200; x = x₀ + width × i ÷ nₓ
Terrain from contours and terrain grids terrain.js64-bit- ModelCraft
-
Entourage parts into the model
Converts each part's triangles from millimeters to meters.
p (m) = p (mm) ÷ 1000
Starter library: plants and entourage sizes starter.js64-bit- ModelCraft
-
Plant scaled to its listed size
The scale that makes a plant model as wide and tall as the species' data says.
s_xy = 1000 × spread ÷ max(Δx, Δy, 1); s_z = 1000 × height ÷ max(z_max, 1)
Starter library: plants and entourage sizes starter.js64-bit- ModelCraft
-
Orientation of three points
Twice the signed area of a triangle: which way it turns.
(b − a) × (c − a) = (bₓ − aₓ)(c_y − a_y) − (b_y − a_y)(cₓ − aₓ)
Triangles inside a trimmed face io/3dm/cdt.js64-bit- ModelCraft
- PartCraft
-
Point inside a circumcircle
Whether a fourth point lies inside the circle through three others.
determinant of the rows (pₓ − dₓ, p_y − d_y, |p − d|²) for p = a, b, c; inside when it is positive
Triangles inside a trimmed face io/3dm/cdt.js64-bit- ModelCraft
- PartCraft
-
Triangle that holds a point
Walks from the last triangle toward the point, then searches all triangles if the walk fails.
Triangles inside a trimmed face io/3dm/cdt.js64-bit- ModelCraft
- PartCraft
-
Point insertion
Splits the triangle a new point falls in, or the side it falls on.
ε = 10⁻⁶ × orient(a, b, c); on a side when a sub-area ≤ ε
Triangles inside a trimmed face io/3dm/cdt.js64-bit- ModelCraft
- PartCraft
-
Edge flip
Flips an edge while the opposite corner lies inside the circumcircle.
Triangles inside a trimmed face io/3dm/cdt.js64-bit- ModelCraft
- PartCraft
-
Flips with no new points
Makes an existing triangulation Delaunay by flipping edges.
Triangles inside a trimmed face io/3dm/cdt.js64-bit- ModelCraft
- PartCraft
-
Welded corners in meters
Merges corners that coincide and converts them from millimeters to meters.
key = round(x ÷ q), round(y ÷ q), round(z ÷ q); p (m) = p (mm) × 0.001
STEP import: welding and meters io/step-import.js64-bit- ModelCraft
-
Triangles of a referenced object
The target's triangles in the modified mesh's space, for booleans and similar modifiers.
q = (toLocal × placement) × p
Modifier references and lattice cages mesh/mod-eval.js64-bit- ModelCraft
-
Cage point displacements
How far each cage point has been moved from its place on the even grid.
rest = min + (max − min) × i ÷ (n − 1); disp = M × now − M × rest
Modifier references and lattice cages mesh/mod-eval.js64-bit- ModelCraft
-
Cage around a mesh
A box of grid points around a mesh's bounds.
d = pad × max side; min′ = min − d; max′ = max + d; p = min′ + (max′ − min′) × i ÷ (n − 1)
Modifier references and lattice cages mesh/mod-eval.js64-bit- ModelCraft
-
Multiplicity of a knot
How many times a value occurs in a knot vector.
count of |Uᵢ − u| ≤ tol × (U_last − U_first)
Knot vectors nurbs/basis.js64-bit- ModelCraft
- PartCraft
-
Distinct knots
The different knot values with their multiplicities.
a knot joins the previous one when |x − u_prev| ≤ tol × range
Knot vectors nurbs/basis.js64-bit- ModelCraft
- PartCraft
-
Clamped uniform knot vector
A knot vector with evenly spaced interior knots.
uᵢ = a + (b − a) × i ÷ (inner + 1)
Knot vectors nurbs/basis.js64-bit- ModelCraft
- PartCraft
-
Knot vector check
Checks a knot vector read from a file: count, order, clamping and multiplicities.
Knot vectors nurbs/basis.js64-bit- ModelCraft
- PartCraft
-
Greville abscissae
One parameter value per control point.
gᵢ = (Uᵢ₊₁ + … + Uᵢ₊ₚ) ÷ p
Knot vectors nurbs/basis.js64-bit- ModelCraft
- PartCraft
-
Binomial coefficients
The number of ways to choose k of n.
C(n, k) = C(n − 1, k − 1) + C(n − 1, k)
Knot vectors nurbs/basis.jsExact- ModelCraft
- PartCraft
-
A number as IGES text
Writes one real number into the file.
whole numbers below 10¹⁵: digits and a point; otherwise String(x) with E → D
IGES files of NURBS curves and surfaces nurbs/iges.js64-bit- ModelCraft
- PartCraft
-
Global section
States the file's number sizes, unit, resolution and largest coordinate.
unit flag 2 (MM); scale 1; resolution 10⁻⁶; largest coordinate = max |x| over all control points
IGES files of NURBS curves and surfaces nurbs/iges.js64-bit- ModelCraft
- PartCraft
-
A number from IGES text
Reads one real number from the file.
IGES files of NURBS curves and surfaces nurbs/iges.js64-bit- ModelCraft
- PartCraft
-
Unit factors
Millimeters per file unit, by the file's unit flag.
1: 25.4; 2: 1; 3: 25.4 × 12; 4: 1609344; 5: 10⁶; 6: 1000; 7: 10⁶; 8: 10⁻³; 9: 10⁻³; 10: 10; 11: 25.4 × 10⁻⁶
IGES files of NURBS curves and surfaces nurbs/iges.js64-bit- ModelCraft
- PartCraft
-
Control points in millimeters
Scales a curve's control points by the file's unit as it is read.
scale = UNITS[flag] (1 when unknown); p′ = p × scale
IGES files of NURBS curves and surfaces nurbs/iges.js64-bit- ModelCraft
- PartCraft
-
Volume and box of each body
The volume and bounding box the body list shows.
volume = Σ volume of the body's solids; box = min and max over them
Bodies: volume, move and scale brep-bodies.js64-bit- PartCraft
-
Move matrix
The matrix a Move body feature applies: by distances, point to point, about an axis, or plane to plane.
points: T(to − from); align: rotate n_a onto ∓n_b about c, then t = n_b ((o_b − c) · n_b)
Bodies: volume, move and scale brep-bodies.js64-bit- PartCraft
-
Shape under a move or a uniform scale
Applies the matrix or the scale to a solid in the kernel.
Bodies: volume, move and scale brep-bodies.js64-bit- PartCraft
-
Scale center and affine map
Chooses the center of a scale and builds the map for unequal factors.
c = picked point, or (box min + box max) × 0.5; A = diag(sₓ, s_y, s_z); t = c (1 − s)
Bodies: volume, move and scale brep-bodies.js64-bit- PartCraft
-
Scalar arithmetic and comparison
Adds, subtracts, multiplies, divides and compares two plain numbers.
a + b, a − b, a × b, a ÷ b, a < b, a = b
CraftScript operators in the interpreter cs-vm.js64-bit- PartCraft
-
Matrix multiply, divide and power
The *, /, \ and ^ operators on matrices.
A ÷ B = (solve(Bᵀ, Aᵀ))ᵀ; Aⁿ by repeated squaring; A⁻ⁿ = (A⁻¹)ⁿ
CraftScript operators in the interpreter cs-vm.js64-bit- PartCraft
-
Values of a counted loop
The value the loop variable takes on each pass of for x = a:s:b.
xₖ = a + k × s; last value = b when |xₖ − b| < 10⁻¹⁰ × max(1, |b|)
CraftScript operators in the interpreter cs-vm.js64-bit- PartCraft
-
Number text in the echo
The text printed for a number when a statement has no semicolon.
integer below 10¹⁵: all digits; otherwise 5 significant digits
CraftScript values: storage, reading and number text cs-values.js64-bit- PartCraft
-
Matrix text in the echo
The text printed for a vector or matrix.
CraftScript values: storage, reading and number text cs-values.js64-bit- PartCraft
-
Arrays read from a saved workspace
Checks and copies a numeric array from a part file or a worker message.
CraftScript values: storage, reading and number text cs-values.js64-bit- PartCraft
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.