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

  • LAS scale and offset

    Chooses the scale and offset the LAS file stores its integer coordinates with.

    scale = first of 0.0001, 0.001, 0.01, 0.1, 1 with extent ÷ scale < 2e9; offset = ⌊min ÷ 100⌋ × 100

    Registered scans written as LAS and E57 scan-export.js
    • CadCraft
    • BimCraft
    64-bit
  • LAS point record

    Stores one point's x, y, z as integers in the LAS file.

    X = round((p − offset) ÷ scale)

    Registered scans written as LAS and E57 scan-export.js
    • CadCraft
    • BimCraft
    32-bit in part
  • E57 point record

    Stores one point's x, y, z in an E57 data packet and widens the scan's bounds.

    Registered scans written as LAS and E57 scan-export.js
    • CadCraft
    • BimCraft
    32-bit in part
  • Numbers written as text in the E57 header

    Writes a bound or a time stamp as text in the E57 XML section.

    Registered scans written as LAS and E57 scan-export.js
    • CadCraft
    • BimCraft
    64-bit
  • Elements above, and the gap to each

    What sits over an element's footprint and how far above its top each one starts.

    gap = max(0, lowest Y of the other element − top Y of this element)

    Assistant answers: what is above an element ask-tools.js
    • BimCraft
    32-bit in part
  • Placed triangles of an element

    Every triangle of an element in the file's Z-up coordinates and length unit.

    p = (x, −z, y) of (C⁻¹ · M · v) × (1000 ÷ unitMm)

    Element triangles for analysis ifc-util.js
    • BimCraft
    32-bit in part
  • Body mesh in the item's own frame

    The item's 3D shape in millimeters, relative to its own placement.

    p_item = round(W⁻¹ · p × mm, 4 decimals)

    Library items from IFC types libitem-ifc.js
    • BimCraft
    32-bit in part
  • Width, depth and height

    The item's overall size from its body.

    width = max x − min x; depth = max y − min y; height = max z − min z

    Library items from IFC types libitem-ifc.js
    • BimCraft
    32-bit in part
  • Plan outline from the type's footprint

    The item's 2D plan symbol, from the type's FootPrint or Plan curves.

    (x, y) = round(coordinate × mm, 4 decimals)

    Library items from IFC types libitem-ifc.js
    • BimCraft
    64-bit
  • Sizes from properties

    Width, depth and height from the type's properties when the body gave none.

    size = round(value × mm, 4 decimals) for a length measure

    Library items from IFC types libitem-ifc.js
    • BimCraft
    64-bit
  • Mesh points of an element

    The vertices of each element as the USD file stores them.

    (x′, y′, z′) = P · (x, y, z, 1); stored as (x′, −z′, y′)

    USD export and render hand-off usd-bimcraft.js
    • BimCraft
    32-bit in part
  • Inverse of a placement

    The matrix that undoes a model's placement.

    R⁻¹ = Rᵀ ÷ s², s² = m₀² + m₁² + m₂²; t⁻¹ = −R⁻¹ · t

    USD export and render hand-off usd-bimcraft.js
    • BimCraft
    64-bit
  • Site transform back to the file's coordinates

    The transform on each Site that returns the exported points to the IFC file's own coordinates.

    toFile = A · (P · C)⁻¹ · A⁻¹

    USD export and render hand-off usd-bimcraft.js
    • BimCraft
    64-bit
  • Storey elevation in meters

    Each storey's elevation as an attribute of the USD file.

    elevation in m = elevation × (mm per file unit ÷ 1000)

    USD export and render hand-off usd-bimcraft.js
    • BimCraft
    64-bit
  • Inverse of a placement (hand-off)

    The matrix that undoes a model's placement, for the render hand-off.

    R⁻¹ = Rᵀ ÷ s²; t⁻¹ = −R⁻¹ · t

    USD export and render hand-off handoff-bim.js
    • BimCraft
    64-bit
  • Viewer scene to the USD stage

    The transform that takes camera, sun and lamp positions from the viewer's scene to the exported file's world.

    toStage = A · (P · C)⁻¹; A alone when the model has no coordination matrix

    USD export and render hand-off handoff-bim.js
    • BimCraft
    64-bit
  • Mesh handed to the solid kernel

    Welds the mesh's corners and passes it to manifold-3d.

    weld grid = 10⁻⁶ × max(Δx, Δy, Δz); positions → Float32Array

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Boolean of two solids

    The difference, union or intersection of two element meshes.

    c = center of a's box; R = (a − c) OP (b − c); result = R + c

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Element minus all its openings

    Subtracts every opening from an element, one after another.

    A₀ = base − c; Aᵢ = Aᵢ₋₁ − (cutterᵢ − c); result = Aₙ + c

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Face planes of a convex cutter

    Finds the outward planes of a cutter and decides whether it is convex.

    n = (b − a) × (c − a) ÷ |…|; d = n · a; convex when n · p − d ≤ 10 ε for every corner p

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Polygon split by a plane

    Cuts a convex polygon into the part in front of a plane and the part behind it.

    t = dₐ ÷ (dₐ − d_b); x = a + (b − a) t

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Mesh clipped by a plane

    Keeps the part of a mesh on one side of a plane and closes the cut.

    dᵢ = (pᵢ − p) · n; ε = 10⁻⁹ × (d_max − d_min); cut point = a + (b − a) dₐ ÷ (dₐ − d_b)

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Cap of a cut

    Joins the cut segments into loops, sorts outer loops from holes and fills them.

    key = round(x ÷ tol), round(y ÷ tol), round(z ÷ tol); area = ½ |Σ (xᵢ yᵢ₊₁ − xᵢ₊₁ yᵢ)|

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Half-space cut

    Removes the part of an element behind a plane, optionally only inside a polygon boundary.

    L = 4 × max(1, box diagonal) + |P₀ − box min|; prism height = 2 L

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Vertex data of one geometry

    Returns a geometry's positions and normals for drawing and for measuring.

    IFC geometry handed to the apps ifc/api.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Placement matrix of each piece

    The matrix that takes a geometry's vertices to model space in meters, Y up.

    M = C × Y-up × scale(u) × placement

    IFC geometry handed to the apps ifc/api.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Shift to the origin

    Finds the translation that brings the model near the origin.

    c = (box min + box max) ÷ 2 of the first element; C = translate(−(Y-up × scale(u) × placement × c))

    IFC geometry handed to the apps ifc/api.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • File units to meters, Z up to Y up

    Scales a placement by the file's length unit and turns its axes.

    M′ = Y-up × scale(u) × M

    IFC geometry handed to the apps ifc/api.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Face points

    The new point in the middle of each face.

    F = Σ corners ÷ n

    Subdivision surfaces mesh/subdiv.js
    • ModelCraft
    64-bit
  • Edge points

    The new point on each edge.

    m = (a + b) ÷ 2; e = (a + b + F₁ + F₂) ÷ 4; point = e + (m − e) × s for 0 ≤ s < 1

    Subdivision surfaces mesh/subdiv.js
    • ModelCraft
    32-bit in part
  • Vertex points

    Where each old vertex moves to.

    smooth = (F̄ + 2 R̄ + (n − 3) V) ÷ n; crease = (6 V + a + b) ÷ 8; k = min(1, (sₐ + s_b) ÷ 2); point = smooth + (crease − smooth) × k

    Subdivision surfaces mesh/subdiv.js
    • ModelCraft
    32-bit in part
  • Edge sharpness per level

    The sharpness each new edge inherits.

    s′ = max(0, s − 1); open edge: ∞; crease layer = min(1, s′ ÷ 4)

    Subdivision surfaces mesh/subdiv.js
    • ModelCraft
    32-bit in part
  • Texture coordinates and other corner layers

    Interpolates per-corner values onto the new quads.

    corner: own value; edge: mean of two; face: mean of the face's corners

    Subdivision surfaces mesh/subdiv.js
    • ModelCraft
    64-bit
  • Limit positions

    Where each vertex of an all-quad mesh lies on the limit surface.

    smooth: (n² V + 4 Σ E + Σ F) ÷ (n (n + 5)); crease or border: (4 V + a + b) ÷ 6

    Subdivision surfaces mesh/subdiv.js
    • ModelCraft
    64-bit
  • Scaled triangles packed for export

    Turns the scaled triangles back into a mesh for the file writers.

    Scaled mesh for printing print-export.js
    • PartCraft
    32-bit in part
  • Triangles of the part's mesh

    Reads the part's mesh as a list of triangles for the scaling and splitting code.

    Scaled mesh for printing print-export.js
    • PartCraft
    64-bit
  • Scaled STL or 3MF file

    Builds the file a person downloads from the Scale for printing dialog.

    Scaled mesh for printing print-export.js
    • PartCraft
    32-bit in part
  • Body, volume and area from a field

    The mesh that to_body returns, with its volume, area and triangle count.

    Field builtins for scripts engineer/cs-lib-field.js
    • PartCraft
    32-bit in part
  • Volume of a field

    The number field_volume returns to the script.

    Field builtins for scripts engineer/cs-lib-field.js
    • PartCraft
    32-bit in part
  • Density map for a graded size

    Turns a 0 to 1 density array into a profile that drives a cell size or wall thickness.

    d = clamp(D, 0, 1), stored in 32 bits; size = v₀ + (v₁ − v₀) × d

    Field builtins for scripts engineer/cs-lib-field.js
    • PartCraft
    32-bit in part
  • Distance at points

    The signed distance of a field at each row of a points matrix.

    Field builtins for scripts engineer/cs-lib-field.js
    • PartCraft
    64-bit
  • Inside or outside on a box grid

    Marks each cell of a box as inside (−1) or outside (0) the field.

    nᵢ = round((maxᵢ − minᵢ) ÷ h); sample at min + (i + ½) × h

    Field builtins for scripts engineer/cs-lib-field.js
    • PartCraft
    64-bit
  • Overhang reported by the manufacturing check

    The overhang problem mfg_check adds, with its area and locations.

    reported when area > 4 × h²

    Field builtins for scripts engineer/cs-lib-field.js
    • PartCraft
    64-bit
  • Clear spacing a bar asks for

    The least clear distance between parallel bars for a bar size and aggregate.

    max(25.4, d_b, 4/3 × aggregate) mm; BS bars: max(d_b, aggregate + 5, 20) mm

    Rebar congestion map of a footing congestion.js
    • DetailCraft
    64-bit
  • Free gap at a point

    The length of the free stretch that contains a point, between the bars either side of it.

    gap = right − left; 0 inside a bar

    Rebar congestion map of a footing congestion.js
    • DetailCraft
    64-bit
  • Need and grid size

    Sets what the concrete needs and how fine the map is.

    cell = max(5, given, or max(10, ⌈max(L, B) ÷ 160 ÷ 5⌉ × 5)); columns = round(L ÷ cell)

    Rebar congestion map of a footing congestion.js
    • DetailCraft
    64-bit
  • Opening and ratio per cell, and the worst place

    Fills the map and finds the tightest opening and the number of cells that are too tight.

    opening = min of the gaps in each layer; ratio = need ÷ opening

    Rebar congestion map of a footing congestion.js
    • DetailCraft
    64-bit
  • Share of the open area that is too tight

    The fraction of free cells whose ratio is over 1.

    share = cells with ratio > 1 ÷ cells with opening > 0

    Rebar congestion map of a footing congestion.js
    • DetailCraft
    32-bit in part
  • The congestion problem

    The warning or error listed for a footing whose steel is too tight.

    Rebar congestion map of a footing congestion.js
    • DetailCraft
    32-bit in part
  • Positions stored as offsets from the origin

    The kept points as 32-bit offsets from a whole-unit origin.

    pos = fround(x − floor(min))

    Point cloud positions and read-in values pointcloud.js
    • CadCraft
    • BimCraft
    32-bit in part

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.