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

  • Stair from a sketched walking line

    Turns a walking line of one, two or three segments into a straight, L or U stair: its direction, width, gap, split and tread depth.

    n = max(2, ⌈H ÷ riser_max − 1e-9⌉); tread = max(50, line length ÷ (n − 1)); split = first leg ÷ total

    Stair risers, treads and stairwell stair-sketch.js
    • BimCraft
    64-bit
  • Sheet scale as feet per point

    The number of feet in the building that one PDF point stands for on a sheet drawn at 1:ratio.

    ft per point = ratio × (25.4 ÷ 72) ÷ 304.8 = ratio ÷ 864

    Quantities handed to TakeoffCraft res-takeoff.js
    • BimCraft
    Exact
  • Mark coordinates on the sheet

    Maps a plan point to the sheet and writes it as the PDF-point coordinates of a takeoff mark.

    mark = round(sheet mm × 72 ÷ 25.4 × 100) ÷ 100

    Quantities handed to TakeoffCraft res-takeoff.js
    • BimCraft
    64-bit
  • Roof pitch as rise per 12

    Converts a pitch in degrees to the rise per 12 that TakeoffCraft uses for sloped areas and lengths.

    rise per 12 = round(12 × tan θ × 10000) ÷ 10000

    Quantities handed to TakeoffCraft res-takeoff.js
    • BimCraft
    64-bit
  • Walls as runs with a height

    Sends each wall as a run along its center line, grouped by wall type and height.

    height (ft) = round(height ÷ 304.8 × 100) ÷ 100

    Quantities handed to TakeoffCraft res-takeoff.js
    • BimCraft
    64-bit
  • Door and window positions

    Places a count mark at the middle of each door and window along its wall.

    at = a + (b − a) ÷ L × (offset + width ÷ 2)

    Quantities handed to TakeoffCraft res-takeoff.js
    • BimCraft
    64-bit
  • Roof faces and roof lines

    Sends each roof face as a plan area with its pitch, and the ridges, hips, valleys, eaves and rakes as runs.

    face pitch = round(pitch × 100) ÷ 100; line pitch = max over the faces

    Quantities handed to TakeoffCraft res-takeoff.js
    • BimCraft
    64-bit
  • Footings, stem walls and slabs

    Sends slabs as areas with their thickness, and footings and stem walls as runs along the middle of their outline with a width and height.

    mid = (outer + inner) ÷ 2; width (in) = |gap| ÷ 25.4; height (ft) = (z₁ − z₀) ÷ 304.8

    Quantities handed to TakeoffCraft res-takeoff.js
    • BimCraft
    64-bit
  • Width of a footing ring

    The distance between a foundation's outer and inner outlines.

    width = cross(b − a, q − a) ÷ |b − a|

    Quantities handed to TakeoffCraft res-takeoff.js
    • BimCraft
    64-bit
  • Survey points into model millimeters

    Converts survey points from their own unit to millimeters, moves them by the offset and measures heights from the datum.

    x = x_s × unit − offset_x; z = (z_s − datum) × unit

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Offset for far-off survey coordinates

    Finds the move that brings survey coordinates far from the origin onto the building.

    c = (min + max) ÷ 2 × unit; offset = c − target when |c| > 2e6 mm

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Thinning a large point set

    Keeps the lowest point in each square cell of a grid.

    cell index = (⌊x ÷ cell⌋, ⌊y ÷ cell⌋); keep min z

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Cell size when a ground has too many points

    Chooses the thinning cell so that about 20000 points remain.

    cell = √(bounding box area ÷ 20000) × 1.2

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • LandXML units and point order

    Reads a LandXML surface's length unit and its points, which are written northing, easting, elevation.

    x = E × k, y = N × k, z = Z × k; k = 0.01 for centimeters, 1000 for kilometers, 1 ÷ 12 for inches

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Pad outline moved out by the margin

    Moves every edge of the building's outline outward by the pad margin and finds the new corners.

    corner = p₀ + u_prev × cross(p₁ − p₀, u) ÷ cross(u_prev, u)

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Finished grade at a point

    The finished ground height at a point: flat on each pad and sloping away from it to meet the existing ground.

    z = max(z_pad − d ÷ slope, min(z_pad + d ÷ slope, z))

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Sample rings round a pad

    Adds rings of graded points round each pad, out to where its slopes can meet the ground.

    reach = max(|z_max − z_pad|, |z_pad − z_min|) × slope + 500; rings every 500 mm, points every 500 mm

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Cut and fill volumes

    The volume of earth to cut and to fill between the existing and the finished ground, in cubic meters.

    V = Σ (z_finished − z_existing) × cell² ÷ 1e9, cell = 250 mm, sampled at cell centers

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Cut and fill written to the model

    Writes the terrain's cut and fill volumes and its lowest and highest elevation.

    Cut, Fill = round(V, 3) m³

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Cut and fill of each pad

    Writes each pad's level and its cut and fill.

    pad cut = total cut ÷ number of pads

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Pad outline and level

    A pad's outline in site coordinates and its level: the walls' outline moved out by the margin, at the floor's height less the pad depth.

    z_pad = level elevation − depth

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Existing ground points as stored

    Writes the existing ground's points into the model as text.

    x, y, z = Math.round(value) mm

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Terrain body coordinates

    Writes the finished ground as a closed triangulated body in the site's axes.

    coordinate = round(value ÷ unit, 3)

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Datum after raising the ground

    Moves the existing ground up or down and corrects the stored survey datum.

    z′ = z + raise; datum′ = datum − raise ÷ (mm per source unit)

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Paving draped on the ground

    Builds a driveway, walk or patio as a surface on the finished grade and writes its area and volume.

    grid step = max(500, √(box area ÷ 2000)); GrossArea = plan area; GrossVolume = sloped area × thickness

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • LandXML export

    Writes the existing and finished ground as LandXML surfaces.

    value = (mm × k).toFixed(4), k = 0.001 for meters, 1 ÷ 304.8 for feet

    Site ground, building pads and cut and fill res-terrain.js
    • BimCraft
    64-bit
  • Millimeters per survey unit

    The factor from a survey file's length unit to millimeters.

    m = 1000; ft = 304.8; US survey ft = 1200 ÷ 3937 × 1000

    Ground read from a survey file res-ui.js
    • BimCraft
    Exact
  • Ground points from a LAS or LAZ cloud

    Takes the ground-class points of a cloud and thins them to the lowest point in each 1 m cell.

    x = pos[3i] + origin_x; cell = 1000 ÷ (mm per unit)

    Ground read from a survey file res-ui.js
    • BimCraft
    32-bit in part
  • Thinning an elevation grid

    Chooses every how many cells of a GeoTIFF or ASCII grid to read so that about 15000 points remain.

    step = max(1, ⌈√(width × height ÷ 15000)⌉)

    Ground read from a survey file res-ui.js
    • BimCraft
    64-bit
  • Unit, offset and datum of an imported ground

    Sets the unit factor, moves far-off coordinates to the building and picks the datum so the ground near the building sits 200 mm under the first floor.

    datum = median(z near the building) + 200 ÷ k

    Ground read from a survey file res-ui.js
    • BimCraft
    64-bit
  • Roof plane area in Properties

    The sloped area of a manual roof plane shown in its properties.

    area = |½ Σ (xᵢ yᵢ₊₁ − yᵢ xᵢ₊₁)| ÷ cos θ

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

    The lumber schedule's rows: size, stock length, pieces and board feet, with totals.

    board feet shown = bf.toFixed(1)

    Figures shown in the residential panels and schedules res-ui.js
    • BimCraft
    64-bit
  • 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

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.