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

  • Sheet items to PDF operators

    Converts every line, fill, clip and text of a sheet from millimeters to PDF points and writes the page's drawing operators.

    points = mm × 72 ÷ 25.4

    Drawing sheets to scale and the PDF res-sheets.js
    • BimCraft
    64-bit
  • Direction a section line looks

    The unit direction along a section line and the horizontal direction it looks.

    u = (b − a) ÷ |b − a|; look = (−u_y, u_x) or (u_y, −u_x)

    Drawing sheets to scale and the PDF res-sheets.js
    • BimCraft
    64-bit
  • Section line written to the model

    Writes a section line's two ends, its look side and its depth into the model.

    AX, AY, BX, BY, Depth = round(value ÷ unit, 6)

    Drawing sheets to scale and the PDF res-sheets.js
    • BimCraft
    64-bit
  • Ceiling tile grid

    Lays a ceiling pattern's grid lines inside a ceiling's outline, with a tile centered on the outline's box.

    lines at c + m ÷ 2 + j × m; crossing = q_a + (q_b − q_a) × (k − p_a) ÷ (p_b − p_a)

    Drawing sheets to scale and the PDF views-model.js
    • BimCraft
    64-bit
  • Crop region of a view

    Orders the four numbers of a crop rectangle and rejects one that is not a real rectangle.

    valid when x₁ − x₀ ≥ 100 and y₁ − y₀ ≥ 100

    Drawing sheets to scale and the PDF views-model.js
    • BimCraft
    64-bit
  • View positions stored on a sheet

    Stores where each view sits on a hand-arranged sheet and at which scale.

    x, y = round(value, 2) mm; ratio = whole number

    Drawing sheets to scale and the PDF views-model.js
    • BimCraft
    64-bit
  • Another level drawn under a plan

    Moves another level's plan linework into this level's plan as plain segments.

    p′ = (T₀ x + T₄ y + T₁₂, T₁ x + T₅ y + T₁₃); arcs as 12 chords

    Drawing sheets to scale and the PDF views-model.js
    • BimCraft
    64-bit
  • Number of risers and riser height

    The number of risers a floor-to-floor height needs, each riser's height, and whether the riser, tread, width and handrail meet the limits.

    n = max(2, ⌈H ÷ riser_max − 1e-9⌉); r = H ÷ n; treads = n − 1

    Stair risers, treads and stairwell res-stair.js
    • BimCraft
    64-bit
  • Treads of a straight flight

    The plan rectangle and the height of each tread of a straight stair.

    tread i spans i × d to (i + 1) × d; z = (i + 1) × r

    Stair risers, treads and stairwell res-stair.js
    • BimCraft
    64-bit
  • Treads before and after a turn

    Divides the treads of an L, U or winder stair between the flight before the turn and the one after.

    before = max(1, min(T − turn − 1, round((T − turn) × split))); after = T − before − turn

    Stair risers, treads and stairwell res-stair.js
    • BimCraft
    64-bit
  • Landing and second flight of a U stair

    The half landing of a U stair and the treads of the flight that comes back beside the first.

    landing width = 2 w + gap; flight 2 center at ±(w + gap); z = z_landing + (j + 1) × r

    Stair risers, treads and stairwell res-stair.js
    • BimCraft
    64-bit
  • Winder treads

    Fans three winder treads from the inside corner of a quarter turn.

    outer path of length 2 w cut at 2 w k ÷ 3, k = 0 … 3

    Stair risers, treads and stairwell res-stair.js
    • BimCraft
    64-bit
  • Spiral stair

    The wedge treads of a spiral stair round its post, the handrail, the walk line and the outline.

    Δθ = tread ÷ (r_post + 12 in); tread i from θ₀ ± i Δθ; arcs chorded at ≤ 6°

    Stair risers, treads and stairwell res-stair.js
    • BimCraft
    64-bit
  • Floor-to-floor height of a stair

    The height a stair climbs: from its level to the level above, else its own fixed height.

    H = elevation_top − elevation_bottom when that is more than 100 mm

    Stair risers, treads and stairwell res-stair.js
    • BimCraft
    64-bit
  • Stairwell opening

    Finds the treads and landings that have less than the required headroom under the floor above; their outline is cut out of that floor.

    cut where z_tread + headroom > H + offset − thickness

    Stair risers, treads and stairwell res-stair.js
    • BimCraft
    64-bit
  • Center post of a spiral stair

    Builds the spiral stair's round post as a 24-sided column.

    vertices at r × (cos 2πj ÷ 24, sin 2πj ÷ 24)

    Stair risers, treads and stairwell res-stair.js
    • BimCraft
    64-bit
  • Riser and tread written to the model

    Writes the number of risers and treads, the riser height, the tread length and the required headroom.

    RiserHeight, TreadLength = round(value ÷ unit, 6)

    Stair risers, treads and stairwell res-stair.js
    • BimCraft
    64-bit
  • Stair settings written to the model

    Writes the stair's start point, angle, width, riser limit, tread, split and rail height.

    lengths = round(value ÷ unit, 6); Angle = round(angle, 6); Split = round(split, 4)

    Stair risers, treads and stairwell res-stair.js
    • BimCraft
    64-bit
  • 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

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.