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

  • Subtitle timestamp

    A cue time as an SRT or WebVTT timestamp.

    ms = round(s × 1000); h, m, s, ms by integer division

    Narration cue times narration.js
    • BimCraft
    64-bit
  • Stored size, roughness and bump

    The numbers saved with a photo material.

    x = round(clamp(x) × 100) ÷ 100

    Photo material settings photo-materials.js
    • BimCraft
    64-bit
  • 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
  • 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
  • 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
  • Filmic tone curve

    Maps scene brightness to screen brightness for the filmic view transform.

    h(x) = (x (0.15 x + 0.05) + 0.004) ÷ (x (0.15 x + 0.5) + 0.06) − 0.02 ÷ 0.3; output = h(2 c) ÷ h(11.2)

    Real-time view and render bench rt/rt-post.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Baked probe light

    Collects the bounce light at each probe and removes the sky's own part.

    shᵢ,ₖ = bakedᵢ,ₖ − skyₖ (k = 0…11)

    Real-time view and render bench rt/rt-gi.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Mean radiance per pixel

    Averages the accumulated samples of each pixel for the bench and the parity comparison.

    mean = Σ samples ÷ n

    Real-time view and render bench render/bench-kernels.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Scene for the standalone viewer

    Packs the drawn scene into the viewer's file.

    Real-time view and render bench rt/rt-export.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • 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
  • Unit factor

    Chooses the factor that turns the file's unit into meters.

    k = meters per file unit, or 0.001 when that is missing, zero or not finite

    3DM import: units, placements and mesh points io/3dm-import.js
    • ModelCraft
    • PartCraft
    64-bit
  • Mesh points in meters

    Scales a mesh's points and builds the model's mesh from them.

    p′ = p × k

    3DM import: units, placements and mesh points io/3dm-import.js
    • ModelCraft
    • PartCraft
    64-bit
  • Block placement matrix

    Turns a block reference's matrix into the model's placement.

    m[c × 4 + r] = x[r × 4 + c]; translation × k

    3DM import: units, placements and mesh points io/3dm-import.js
    • ModelCraft
    • PartCraft
    64-bit
  • Curve points in meters

    Scales each curve's points and drops segments of no length.

    a′ = a × k; kept when a′ ≠ b′

    3DM import: units, placements and mesh points io/3dm-import.js
    • ModelCraft
    • PartCraft
    64-bit
  • Mesh record: 32-bit and 64-bit points

    Reads a mesh's points from the file and chooses between its 32-bit and 64-bit copies.

    use the 64-bit points when |aᵢ − vᵢ| ≤ |vᵢ| × 10⁻⁶ + 10⁻⁶ × max(1, |aᵢ|) for every coordinate

    3DM import: units, placements and mesh points io/3dm/objects.js
    • ModelCraft
    • PartCraft
    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
  • Single values by type

    Reads one property value with the width the file states.

    FBX reader: number types as stored io/fbx-parse.js
    • ModelCraft
    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.