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.

  • 6,917 calculations in 1,248 source files
  • 143 exact
  • 6,286 in 64-bit
  • 335 with a 32-bit step
  • Last reviewed

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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • BimCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • Number of copies

    How many placements the enabled Array items make together.

    copies = Π countᵢ

    Group modifiers: scale and array placements group-mods.js
    • ModelCraft
    Exact
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • Edge flip

    Flips an edge while the opposite corner lies inside the circumcircle.

    Triangles inside a trimmed face io/3dm/cdt.js
    • ModelCraft
    • PartCraft
    64-bit
  • Flips with no new points

    Makes an existing triangulation Delaunay by flipping edges.

    Triangles inside a trimmed face io/3dm/cdt.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • Clamped uniform knot vector

    A knot vector with evenly spaced interior knots.

    uᵢ = a + (b − a) × i ÷ (inner + 1)

    Knot vectors nurbs/basis.js
    • ModelCraft
    • PartCraft
    64-bit
  • Knot vector check

    Checks a knot vector read from a file: count, order, clamping and multiplicities.

    Knot vectors nurbs/basis.js
    • ModelCraft
    • PartCraft
    64-bit
  • Greville abscissae

    One parameter value per control point.

    gᵢ = (Uᵢ₊₁ + … + Uᵢ₊ₚ) ÷ p

    Knot vectors nurbs/basis.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    Exact
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • A number from IGES text

    Reads one real number from the file.

    IGES files of NURBS curves and surfaces nurbs/iges.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • PartCraft
    64-bit
  • 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.js
    • PartCraft
    64-bit
  • 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.js
    • PartCraft
    64-bit
  • 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.js
    • PartCraft
    64-bit
  • 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.js
    • PartCraft
    64-bit
  • 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.js
    • PartCraft
    64-bit
  • 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.js
    • PartCraft
    64-bit
  • 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.js
    • PartCraft
    64-bit
  • Matrix text in the echo

    The text printed for a vector or matrix.

    CraftScript values: storage, reading and number text cs-values.js
    • PartCraft
    64-bit
  • 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.js
    • PartCraft
    64-bit

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.