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

  • Board feet of a framing in Properties

    Shows the piece count and board feet of one framing.

    shown = Math.round(BoardFeet)

    Figures shown in the residential panels and schedules res-ui.js
    • BimCraft
    64-bit
  • Cut and fill in Properties

    Shows the terrain's cut and fill volumes.

    shown = V.toFixed(1) m³

    Figures shown in the residential panels and schedules res-ui.js
    • BimCraft
    64-bit
  • Direction and height of a new stair

    The direction a new stair runs, from its start point to the pointer, and the height it climbs.

    angle = atan2(Δy, Δx) × 180 ÷ π; height = elevation above − elevation here

    Figures shown in the residential panels and schedules res-ui.js
    • BimCraft
    64-bit
  • Building width on an elevation (fallback)

    The overall width of the building across a view direction, used for the width note on an elevation when the wall-based width is not available.

    x = q · r ± t ÷ 2 over every wall end; width from min to max

    Figures shown in the residential panels and schedules res-ui.js
    • BimCraft
    64-bit
  • Inverse of a level's placement

    Inverts a level's 4×4 world matrix to bring site coordinates back into the level's plan.

    R⁻¹ = Rᵀ; t⁻¹ = −Rᵀ t

    Figures shown in the residential panels and schedules res-ui.js
    • BimCraft
    64-bit
  • Model triangles in plan millimeters

    Collects every element's triangles from the loaded model and converts them from viewer meters to plan millimeters.

    p′ = M × (x, y, z, 1)

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    32-bit in part
  • Projection and section cut

    Projects each triangle into view coordinates and finds where the section plane cuts it.

    x = p · right; y = z; depth = p · dir; cut point = a + (b − a) × (c₀ − d_a) ÷ (d_b − d_a)

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Triangle clipped at a depth

    Keeps the part of a triangle behind the section plane, or in front of the far limit.

    f = (d₀ − d_a) ÷ (d_b − d_a); new vertex = a + (b − a) × f

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Depth buffer and the visibility test

    Rasterizes every triangle's depth onto a pixel grid and tests whether an edge sample is covered.

    s = 1600 ÷ max(W, H); visible when d ≤ nearest depth in 3 × 3 pixels + tol; tol = max(3, 0.002 × depth range, 4 ÷ s)

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Triangle depth on the pixel grid

    Writes a triangle's depth into each pixel whose center it covers, keeping the nearest.

    d = w₀ d_a + w₁ d_b + w₂ d_c at the pixel center, barycentric weights

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    32-bit, display only
  • Visible runs of an edge

    Samples each feature edge and keeps the stretches that are visible as drawn lines.

    n = max(1, ⌈edge length in pixels ÷ 0.75⌉); samples at a + (b − a) × k ÷ n

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Boundary and crease edges

    Finds the edges of an element's triangles that are open boundaries or creases sharper than 25 degrees.

    crease when |n₁ · n₂| < cos 25°; vertices matched by round(2 × coordinate)

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Cut segments joined into loops

    Joins the segments where the section plane cuts an element into the closed outlines that are filled.

    ends matched by round(2 × coordinate)

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Line cut to the view's frame

    Cuts a drawn line to the view's box.

    Liang–Barsky: t₀, t₁ from q ÷ p on each side

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Cut outline cut to the view's frame

    Cuts a filled section outline to the view's box.

    Sutherland–Hodgman against the four sides

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Collinear pieces joined

    Joins touching pieces of the same element's lines that run in the same direction into one line.

    join when ends ≤ 0.5 mm apart and cos(angle) ≥ 0.99999

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Scan points into the model's space

    Moves every scan point through the cloud's placement matrix into the model's space.

    p′ = M × (x, y, z, 1), stored in a Float32Array

    Scan compared with the model scan-progress.js
    • BimCraft
    32-bit in part
  • Signed distance of a point from a box

    The distance from a scan point to an element's box surface, positive outside and negative inside, and the running sums for the mean and RMS.

    outside: d = √Σ gapₖ²; inside: d = −min distance to a face

    Scan compared with the model scan-progress.js
    • BimCraft
    32-bit in part
  • Coverage, state and deviation of an element

    An element's covered share, its state, and the mean offset and RMS of the scan from its surface.

    coverage = max over large faces of covered cells ÷ cells; mean = Σd ÷ n; rms = √(Σd² ÷ n)

    Scan compared with the model scan-progress.js
    • BimCraft
    32-bit in part
  • Percent complete

    The share of judged elements that are built, by count and by box volume.

    pct = round(1000 × built ÷ judged) ÷ 10; by volume: round(1000 × V_built ÷ V_judged) ÷ 10

    Scan compared with the model scan-progress.js
    • BimCraft
    64-bit
  • Progress report as CSV

    Writes one row per element with its state, coverage, mean offset, RMS, point count and volume.

    coverage: 3 decimals; mean, rms, volume: 4 decimals

    Scan compared with the model scan-progress.js
    • BimCraft
    32-bit in part
  • Slice turned square

    Turns the slice's points by the walls' angle so that every wall runs along one of two axes.

    u = x cos(−α) − y sin(−α); v = x sin(−α) + y cos(−α)

    Walls, doors and rooms proposed from a scan scan-walls.js
    • BimCraft
    64-bit
  • Wall line from a histogram peak

    Finds where a wall lies across its direction: a peak in the histogram of the points, then the mean of the points in that peak.

    peak: h_b ≥ h_b₋₁, h_b > h_b₊₁, three-cell sum ≥ 2 × minimum points; position = mean of the points in the three cells

    Walls, doors and rooms proposed from a scan scan-walls.js
    • BimCraft
    64-bit
  • Wall runs and their ends

    Splits the points on a wall line into runs and keeps the runs that are long, thin and denser than what lies beside them.

    split at gaps > 450 mm; keep when length ≥ 800 mm, min(side counts) ≤ 0.25 × count, core density ≥ 3 × side density

    Walls, doors and rooms proposed from a scan scan-walls.js
    • BimCraft
    64-bit
  • Door gaps

    Finds a door where two wall runs on one line are a door's width apart.

    gap = second.from − first.to; door when 600 ≤ gap ≤ 1300; width = Math.round(gap)

    Walls, doors and rooms proposed from a scan scan-walls.js
    • BimCraft
    64-bit
  • Plan slice of a scanned mesh

    Finds where a horizontal plane cuts each triangle of a mesh and samples points along the cut.

    f = (z_cut − z_a) ÷ (z_b − z_a); samples every 20 mm along each cut segment

    Walls, doors and rooms proposed from a scan scan-propose.js
    • BimCraft
    64-bit
  • Plan slice of a point cloud

    Takes the cloud's points in a band above the floor as the plan slice, in millimeters from the cloud's origin.

    k = 304.8 for feet, 304.8006 for US survey feet, 1000 otherwise

    Walls, doors and rooms proposed from a scan scan-propose.js
    • BimCraft
    32-bit in part
  • 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
  • Task duration

    A task's duration in days, counting its start and finish day.

    duration = finish − start + 1

    Construction schedule dates and critical path schedule-io.js
    • BimCraft
    Exact
  • Date read from a project file

    Turns a date and time from a project XML file into a day number.

    day = date part of the text

    Construction schedule dates and critical path schedule-io.js
    • BimCraft
    Exact
  • Link lag read from a project file

    Converts a dependency's lag from tenths of a minute to whole days.

    lag (days) = Math.round(LinkLag ÷ 10 ÷ minutes per day)

    Construction schedule dates and critical path schedule-io.js
    • BimCraft
    64-bit
  • Early and late dates, float and the critical path

    Each task's earliest start and finish, latest start and finish, float, and whether it is critical.

    ES = max(own start, ES_pred + d); EF = ES + dur − 1; LS = min(finish − dur + 1, LS_succ − d); float = LS − ES

    Construction schedule dates and critical path schedule-io.js
    • BimCraft
    Exact
  • Planes of a section cell

    The outward normal and a point of each plane that bounds a section cell, with tilted faces and extra planes.

    n = unit(n₀ + tan a × e_u + tan b × e_v); extra: n = (cos el cos az, cos el sin az, sin el)

    Section volumes in the 3D view section-volume.js
    • BimCraft
    32-bit, display only
  • Corners and edges of a section cell

    The corners, faces and edges of the convex cell its planes bound, drawn as the cell's frame.

    corner = (d_a (n_b × n_c) + d_b (n_c × n_a) + d_c (n_a × n_b)) ÷ (n_a · (n_b × n_c))

    Section volumes in the 3D view section-volume.js
    • BimCraft
    32-bit, display only
  • A plane through a point as an extra plane

    Turns a plane given by a normal and a point into the azimuth, elevation and offset a section cell keeps.

    az = atan2(u_y, u_x); el = asin(clamp(u_z, −1, 1)); off = u · (p − center)

    Section volumes in the 3D view section-volume.js
    • BimCraft
    32-bit, display only
  • Longitude and latitude to local meters

    The position of a point in meters east and north of the address point.

    x = (lon − lon₀) × 111320 × cos(lat₀); y = (lat − lat₀) × 111320

    Site surroundings in local meters site-context.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Local meters back to longitude and latitude

    The longitude and latitude of a local point.

    lon = lon₀ + x ÷ (111320 × cos(lat₀)); lat = lat₀ + y ÷ 111320

    Site surroundings in local meters site-context.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Outlines and heights kept in the site file

    Converts each outline to local meters, thins and rounds it, and sets the item's height.

    ring = round(x × 100) ÷ 100, round(y × 100) ÷ 100; height = source height, else levels × 3

    Site surroundings in local meters site-context.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Thinning a long outline

    Reduces an outline of more than 400 points by keeping every n-th point.

    step = ⌈points ÷ 400⌉; keep indexes divisible by step

    Site surroundings in local meters site-context.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Surface areas and mean absorption of each pair

    The area of each pair of opposite surfaces and their mean absorption in a band.

    S_x = 2 L_y L_z; ᾱ_x = (α_west + α_east) ÷ 2; −ln(1 − ᾱ)

    Reverberation time of a box room stat.js
    • BimCraft
    64-bit
  • Sabine, Eyring, Fitzroy and Arau-Puchades times

    The four reverberation times of the room in a band.

    Sabine: 0.161 V ÷ (S ᾱ + A_air); Eyring: 0.161 V ÷ (−S ln(1 − ᾱ) + A_air); Fitzroy: 0.161 V ÷ S² × Σ Sᵢ ÷ (−ln(1 − ᾱᵢ)); Arau: Π [0.161 V ÷ (−S ln(1 − ᾱᵢ) + A_air)]^(Sᵢ ÷ S)

    Reverberation time of a box room stat.js
    • BimCraft
    64-bit
  • Local origin and merging of points

    Moves every point to a local origin and makes points that fall on the same spot one vertex.

    origin = ⌊min x⌋, ⌊min y⌋; key = round(x ÷ 1e-4), round(y ÷ 1e-4)

    Ground surface triangulation and contours tin.js
    • BimCraft
    • CivilCraft
    64-bit
  • Coordinates handed to the triangulator

    Packs the local coordinates for Delaunator and runs the Delaunay triangulation.

    coords = (x, −y) per vertex

    Ground surface triangulation and contours tin.js
    • BimCraft
    • CivilCraft
    64-bit
  • Boundary clipped to the data and given elevations

    Clips the outer boundary to the convex hull of the data and takes each corner's elevation from a first surface built without it.

    z_corner = elevationAt(x, y) with a 1e-6 edge tolerance

    Ground surface triangulation and contours tin.js
    • BimCraft
    • CivilCraft
    64-bit
  • Triangles kept inside the boundary

    Drops the triangles whose center lies outside the boundary.

    keep when the centroid (Σx ÷ 3, Σy ÷ 3) is inside the boundary polygon

    Ground surface triangulation and contours tin.js
    • BimCraft
    • CivilCraft
    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.