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

  • Runs joined across doors and outside walls moved to their middle

    Joins two runs on one line with a door between them into one wall, and moves a wall that has points on one side only half its thickness outward.

    c = (c₁ + c₂) ÷ 2; outside when the emptier side has < 15% of the other's points; c ← c ± thickness ÷ 2

    Walls, doors and rooms proposed from a scan scan-propose.js
    • BimCraft
    64-bit
  • Wall ends snapped to corners

    Moves a wall's end onto the line of a perpendicular wall when it is within the snap distance.

    end ← c_other when |c_other − end| ≤ 350 mm

    Walls, doors and rooms proposed from a scan scan-propose.js
    • BimCraft
    64-bit
  • Proposed wall coordinates

    Turns each wall back into the slice's own axes and writes its two ends.

    a, b = round(coordinate × 10) ÷ 10

    Walls, doors and rooms proposed from a scan scan-propose.js
    • BimCraft
    64-bit
  • Proposed door offset

    The distance from a wall's start to the near edge of a door in it.

    offset = Math.round(max(0, along − width ÷ 2 − wall start))

    Walls, doors and rooms proposed from a scan scan-propose.js
    • BimCraft
    64-bit
  • Rooms closed by the proposed walls

    The rooms the proposed walls close, each with its area and middle.

    area (m²) = round(area_mm² ÷ 1e6 × 10) ÷ 10

    Walls, doors and rooms proposed from a scan scan-propose.js
    • BimCraft
    64-bit
  • Corners and edges an element offers to Measure

    Collects an element's feature edges and corners in world space for the pointer to snap to.

    p_world = M × p_local; corners merged by round(coordinate × 1e4)

    Points and faces picked for 3D measuring viewer3d.js
    • BimCraft
    32-bit in part
  • Area of the face under the pointer

    The area of the flat face the pointer is on, in world units.

    area = region area × |det M|^(2 ÷ 3)

    Points and faces picked for 3D measuring viewer3d.js
    • BimCraft
    32-bit in part
  • Bounding box of each element

    The world-space box of each element, over every loaded model.

    box = M × (min, max of the element's vertices)

    Points and faces picked for 3D measuring viewer3d.js
    • BimCraft
    32-bit in part
  • Positions and normals handed to the app

    Packs the mesh into the vertex and index arrays the apps read.

    vertices = Float32Array of (x, y, z, nx, ny, nz) per vertex

    Triangle mesh built from IFC geometry ifc/geo-mesh.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Planar face

    Adds one planar face with holes as triangles, all with the face's normal.

    Triangle mesh built from IFC geometry ifc/geo-mesh.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Mesh moved by a matrix

    Adds another mesh, transformed, with its normals turned to match.

    p' = M p; n' = normalize((M⁻¹)ᵀ n); a mirror swaps the winding

    Triangle mesh built from IFC geometry ifc/geo-mesh.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Signed volume

    The volume enclosed by the mesh, positive when the triangles face outward.

    V = Σ a · (b × c) ÷ 6

    Triangle mesh built from IFC geometry ifc/geo-mesh.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Shared vertices

    Merges vertices that fall in the same grid cell, for boolean operations.

    key = (round(x ÷ eps), round(y ÷ eps), round(z ÷ eps))

    Triangle mesh built from IFC geometry ifc/geo-mesh.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Distance from a point to a triangle

    The shortest distance from a point to a triangle, on a corner, an edge or the face.

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    64-bit
  • Segment crossing a triangle

    Where along a straight piece of a run it passes through one triangle of a wall or slab.

    t = (e₂ · (s × e₁)) ÷ (e₁ · (d × e₂))

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    64-bit
  • Clearance between an MEP element and the structure

    The gap reported when a pipe or duct is closer to a structural element than its insulation plus the typed clearance.

    need = (insulation + gap) ÷ 1000; gap = min over vertices p and triangles T of dist(p, T), both ways

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    32-bit in part
  • Run center line as straight pieces

    The center line of a run, part by part, that is tested against walls and slabs.

    bend point k = center + (−n cos(θk ÷ 8) + d₁ sin(θk ÷ 8)) × R, k = 0 … 8

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    64-bit
  • Opening size

    The width and height of the opening a run needs in a wall or slab.

    opening = outside size + 2 × insulation + 2 × gap

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    64-bit
  • Where a run passes through an element

    The position of each opening on the run, its place in plan, and the length of run inside the wall or slab.

    s = s₀ + u × piece length; through = s_leave − s_enter; at = midpoint of the two crossings

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    32-bit in part
  • Picked focus distance

    The distance from the camera to the clicked surface, measured along the view direction.

    focus = round(−(d · view axis ÷ |view axis|) × t × 100) ÷ 100

    Focus distance picked in the view render/ipr.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Linear picture to display values

    Each pixel's final red, green and blue from the linear picture and the post settings.

    AP1 × wb → Rec.709 × 2^exposure → vignette → highlights → contrast → view transform → sRGB → 8 bits

    Rendered picture: mixing, post and color render/pt-post.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • View transform

    The tone curve that brings scene light into the display's range.

    Rendered picture: mixing, post and color render/pt-post.js
    • BimCraft
    • ModelCraft
    64-bit
  • Blur for bloom

    The wide blur of the picture that bloom blends back in.

    r = max(1, round(√(12σ² ÷ 3 + 1) ÷ 2)); three box blurs of radius r per axis

    Rendered picture: mixing, post and color render/pt-post.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Bloom

    The picture blended with three blurs of itself.

    out = img × (1 − a) + (0.5 b₁ + 0.3 b₂ + 0.2 b₃) × a

    Rendered picture: mixing, post and color render/pt-post.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Light group gains

    The color and brightness factor of each light group in a light mix.

    gain = color (linear AP1) × 2^stops

    Rendered picture: mixing, post and color render/pt-mix.js
    • BimCraft
    • ModelCraft
    64-bit
  • Mixed picture

    The linear picture made by adding the light groups with their gains.

    pixel = Σ over groups of (group sum × gain) ÷ samples

    Rendered picture: mixing, post and color render/pt-mix.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Picture or lighting element from the sums

    The linear picture, light mix or one lighting element as a mean per pixel, handed to the post step.

    mean = Σ samples ÷ sample count

    Rendered picture: mixing, post and color render/pt-mix.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • ACES filmic curve

    The default tone curve.

    f(x) = (x (x + 0.0245786) − 0.000090537) ÷ (x (0.983729 x + 0.4329510) + 0.238081)

    Rendered picture: mixing, post and color render/pt-spec.js
    • BimCraft
    • ModelCraft
    64-bit
  • sRGB encoding

    The curve from display-linear values to stored sRGB values.

    c ≤ 0.0031308: 12.92 c; else 1.055 c^(1 ÷ 2.4) − 0.055

    Rendered picture: mixing, post and color render/pt-spec.js
    • BimCraft
    • ModelCraft
    64-bit
  • One pixel to 8 bits

    A pixel's mean color turned into display bytes with the default settings.

    byte = round(sRGB(ACES(Rec.709(AP1 × wb))) × 255)

    Rendered picture: mixing, post and color render/pt-spec.js
    • BimCraft
    • ModelCraft
    64-bit
  • Sample sums on the graphics card

    The running sum of every sample's color for a pixel when the render runs on the graphics card.

    ACC[pixel] += max(sample, 0)

    Rendered picture: mixing, post and color render/pt-wgsl.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Denoiser exposure scale

    The scale that brings the picture to the brightness the denoising network expects.

    scale = 0.18 ÷ 2^(mean of log₂ L over 16 × 16-pixel bins)

    Rendered picture: mixing, post and color render/pt-denoise.js
    • BimCraft
    • ModelCraft
    64-bit
  • Denoiser input

    The color, albedo and normal values given to the denoising network.

    Rendered picture: mixing, post and color render/pt-denoise.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Denoiser output

    The denoised picture taken back to linear values.

    linear = inverse curve(x ÷ norm) ÷ scale

    Rendered picture: mixing, post and color render/pt-denoise.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Distance between two points

    The length a headset measurement reports.

    d = √(Δx² + Δy² + Δz²)

    Headset review: measuring, section cuts and issue cameras xr/xr-core.js
    • BimCraft
    • ModelCraft
    64-bit
  • Snap to a corner

    The corner of the hit triangle nearest the hit, when it is within the snap radius.

    Headset review: measuring, section cuts and issue cameras xr/xr-core.js
    • BimCraft
    • ModelCraft
    64-bit
  • Model to headset transform

    The matrix that places the model in the headset's space.

    M = T(anchor) · R_y(yaw) · S(scale) · T(−at)

    Headset review: measuring, section cuts and issue cameras xr/xr-core.js
    • BimCraft
    • ModelCraft
    64-bit
  • Inverse of a rig or pose

    The inverse of a rigid motion with one uniform scale.

    M⁻¹ = [Rᵀ ÷ s², −(Rᵀ ÷ s²) t], s² = squared length of the first column

    Headset review: measuring, section cuts and issue cameras xr/xr-core.js
    • BimCraft
    • ModelCraft
    64-bit
  • Section plane

    The plane of a section cut through what was pointed at.

    n = normal toward the eye; p = hit − n × depth; d = n·p

    Headset review: measuring, section cuts and issue cameras xr/xr-core.js
    • BimCraft
    • ModelCraft
    64-bit
  • Issue camera

    The viewpoint, direction and up vector saved with an issue, in the app's coordinates.

    to app = M_up⁻¹ · M_rig⁻¹; eye = to app × head position

    Headset review: measuring, section cuts and issue cameras xr/xr-core.js
    • BimCraft
    • ModelCraft
    64-bit
  • The point being pointed at

    The model point, surface normal and triangle under a controller's ray.

    Headset review: measuring, section cuts and issue cameras xr/xr-session.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • A measurement in the headset

    The length shown on the label between two picked points.

    d = |q − p|, shown through the app's length format

    Headset review: measuring, section cuts and issue cameras xr/xr-session.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Where an issue is placed

    The point and camera handed to the app with a new issue.

    Headset review: measuring, section cuts and issue cameras xr/xr-session.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Average and largest sample count

    The two numbers the render dialog states after an adaptive render.

    avg = round(10 × Σ nᵢ ÷ (w × h)) ÷ 10; max = largest nᵢ

    Samples per pixel reported after a render render/render-pt.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • A number as written to the file

    The text of every numeric value in the exported file.

    text = round(x × 10⁶) ÷ 10⁶

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    64-bit
  • Tile size as uvtiling

    The repeat of every texture in the file, from the material's tile size in meters.

    uvtiling = round(10⁶ ÷ size) ÷ 10⁶

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    64-bit
  • Shader parameters

    The constant inputs of the surface shader written to the file.

    Standard Surface: emission = luminance × 0.02; thin film thickness × 1000

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    64-bit
  • Displacement height range

    The lowest height and the span of the height map, which set the displacement texture's levels and the scale written to the file.

    span = max h − min h; level = round(255 (h − min h) ÷ span); scale = displacement scale × span

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Displacement scale written

    The scale input of the displacement shader in the exported file.

    scale = round(10⁶ × displacement scale × span) ÷ 10⁶

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • A value read from the file

    The number or list of numbers in a value attribute.

    MaterialX files: numbers written and read shading/mtlx.js
    • BimCraft
    • 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.