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

  • Default footing size

    The footing's width and depth from the foundation kind, the number of stories and the wall material.

    width = table inches (+ 4 under masonry or concrete) × 25.4; depth = 10 in from 24 in wide, else 8 in

    Foundation parts and quantities res-foundation.js
    • BimCraft
    Exact
  • Outline offset inward

    A polygon moved inward by a distance, with mitred corners.

    corner = intersection of the two neighboring edges, each moved by d along its left normal

    Foundation parts and quantities res-foundation.js
    • BimCraft
    64-bit
  • Parts of a foundation

    The slab, edge beam, stem wall and footing outlines with their bottom and top heights.

    footing ring between offsets (t_stem − w_foot) ÷ 2 and (t_stem + w_foot) ÷ 2; footing top = −bottom + depth

    Foundation parts and quantities res-foundation.js
    • BimCraft
    64-bit
  • Footings stepped to the ground

    Splits each wall's footing and stem into runs whose underside steps down with the ground.

    underside = min(floor((ground − bottom) ÷ step) × step, −bottom), step = 8 × 25.4 mm; sampled every 600 mm

    Foundation parts and quantities res-foundation.js
    • BimCraft
    64-bit
  • Cutting a strip between two cross lines

    Keeps the part of a wall's strip between two distances along the wall.

    t = f_a ÷ (f_a − f_b); point = a + t × (b − a)

    Foundation parts and quantities res-foundation.js
    • BimCraft
    64-bit
  • Ground height under the foundation

    The ground's height relative to the floor at a plan point.

    world = M · (x, y); height = ground(world) − level elevation

    Foundation parts and quantities res-foundation.js
    • BimCraft
    64-bit
  • Quantities of a ring or slab

    Area, length, width, height and volume of a slab, stem wall or footing.

    a = |A_outer| − |A_inner|; length = (P_outer + P_inner) ÷ 2; width = a ÷ length; volume = a × h

    Foundation parts and quantities res-foundation.js
    • BimCraft
    64-bit
  • Quantities of a stepped footing or stem

    The length and volume of a footing or stem wall made of stepped pieces.

    volume = Σ |A_piece| × height; length = Σ P_piece ÷ 2

    Foundation parts and quantities res-foundation.js
    • BimCraft
    64-bit
  • Lumber size for a span

    Picks the smallest size in a span table whose maximum span reaches the span, or the largest size flagged as over.

    first size with span ≤ max + 1e-6 mm

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Span table column for a spacing

    Chooses the 16 inch or the 24 inch column of a span table from the framing spacing.

    |spacing − 609.6| < 50 → 24 inch column, else 16 inch column

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Header size for an opening

    Picks a two-ply header size from the rough opening width, or three plies of 2x12 flagged as over.

    first size with width ≤ max + 1e-6 mm; non-bearing: 2x4 up to 8 ft

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Board feet of a piece

    The board feet of one piece from its nominal size and its length.

    bf = t_nominal × d_nominal × (L ÷ 304.8) ÷ 12

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Stud layer position across a wall

    Finds where the stud layer sits across the wall's thickness, from the wall type's layers.

    y = ±(t ÷ 2 − Σ layers before − layer thickness)

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Where a wall's framing starts and stops

    Finds the framed start and end of a wall at corners and T junctions with other walls.

    t = cross(q − p, e) ÷ cross(d, e)

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Length of a wall piece

    Records a wall piece as a box and takes its length as the longer of its extent along the wall and its height.

    length = max(x₁ − x₀, z₁ − z₀)

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Framing around a wall opening

    Places the jack and king studs, the header, the cripples and the rough sill around each door and window.

    header top = min(head + header depth, underside of top plate); cripples at x₀ + k × spacing

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Studs on layout

    Places the common studs on center from the wall's framed start.

    x = x₀ + k × spacing, k = 1, 2, … while x < x₁ − T

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Line clipped to a polygon

    Finds the stretches of a joist, rafter or truss line that lie inside a floor outline or a roof face.

    t = cross(a − p, e) ÷ cross(d, e); s = cross(a − p, d) ÷ cross(d, e)

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Outline moved in by a distance

    Moves every edge of a floor outline inward by a fixed distance and finds the new corners.

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

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Joist lines and the governing span

    Sets the joist lines across a floor and takes the longest clipped joist as the span that sizes them.

    c = c₀ + spacing, then + spacing while c < c₁ − 1; span = max(t₁ − t₀)

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Joists cut round floor openings

    Makes each joist piece, cutting it 3 inches short of an opening it crosses, and records its length.

    length = s₁ − s₀

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Trusses across a roof

    Places a truss at each spacing along the roof and takes its top profile from the roof's underside.

    top profile sampled at t₀ + (t₁ − t₀) × k ÷ 40, k = 0 … 40

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Rafters and their size

    Sizes the rafters from the longest horizontal run, places them along each roof face and records each one's sloped length.

    run = max((p − o) · n); length = √((t₁ − t₀)² + (z_b − z_a)²)

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Collar ties

    Places a collar tie every 4 feet under each ridge, two thirds of the way from the plate to the ridge, and finds how far it reaches each way.

    z_c = plate + (z_ridge − plate) × 2 ÷ 3; reach by 40 halvings of [0, 20000 mm]

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Ceiling joists

    Lays ceiling joists out like floor joists at the plate and sizes them from the ceiling span table.

    span = max(joist length); z = plate + depth ÷ 2

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Solid of a sloped member

    Builds the solid of a joist, rafter, hip, valley or ridge as a rectangle swept along its 3D line with plumb ends.

    slope = |Δz| ÷ √(Δx² + Δy²); plumb depth = depth × √(1 + slope²)

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Length and board feet written on a piece

    Writes each piece's role, size, length and board feet into the model, and adds up the board feet of the framing.

    Length = round(L ÷ unit, 3); BoardFeet = round(bf × plies, 3)

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Board feet of a framing

    Writes the piece count and the total board feet of one framed wall, floor or roof.

    BoardFeet = round(Σ bf, 2)

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Cut list by stock length

    Groups every framing piece by size and stock length, and totals the counts and board feet.

    stock = max(8 ft, ⌈L ÷ 2 ft⌉ × 2 ft); metric: max(2400, ⌈L ÷ 600⌉ × 600)

    Wall, floor and roof framing layout res-framing.js
    • BimCraft
    64-bit
  • Posts, balusters and rail length

    Places a post at each path point, spaces the balusters between posts and adds up the rail length.

    n = max(0, ⌈(clear − gap) ÷ (gap + b)⌉); s_k = post ÷ 2 + k × (clear − n × b) ÷ (n + 1) + b × (k − ½); length = Σ √(L² + Δz²)

    Railing posts, balusters and rails res-railing.js
    • BimCraft
    64-bit
  • Rail solid along a sloped segment

    Builds each rail as a square bar swept along its 3D segment.

    sweep direction = (d̂ · z, d̂_z, d̂ · x) in the frame across the rail

    Railing posts, balusters and rails res-railing.js
    • BimCraft
    64-bit
  • Railing values written to the model

    Writes the railing's path, height, base, length and counts into the model.

    Points = round(x ÷ unit, 3), round(y ÷ unit, 3); Length = round(length ÷ unit, 6)

    Railing posts, balusters and rails res-railing.js
    • BimCraft
    64-bit
  • Wall under each roof edge

    Finds the drawn wall whose outer face lies along each edge of the building's outline.

    d = |cross(û_wall, m − a)|; match when |d − t ÷ 2| ≤ 2 mm

    Roof faces, gable ends, fascia and soffit res-roof.js
    • BimCraft
    64-bit
  • Per-wall pitch and overhang as stored

    Writes each wall's roof setting (pitched, gable or none, with its pitch and overhang) as the text kept in the model.

    pitch → round(pitch, 4) degrees; overhang → round(overhang, 2) mm

    Roof faces, gable ends, fascia and soffit res-roof.js
    • BimCraft
    64-bit
  • Sloped roof slabs

    Builds one slab per roof face in the face's own sloped plane.

    profile y = ((p − o) · n) ÷ cos θ; depth = thickness ÷ cos θ; sweep direction (0, sin θ, cos θ)

    Roof faces, gable ends, fascia and soffit res-roof.js
    • BimCraft
    64-bit
  • Gable wall profile

    Builds each gable wall from the top of the wall below up to the underside of the roof.

    z sampled at a + (b − a) × k ÷ 64, k = 0 … 64, 1 mm inside the edge

    Roof faces, gable ends, fascia and soffit res-roof.js
    • BimCraft
    64-bit
  • Fascia boards

    Builds a fascia board along each eave and rake run and totals their length.

    length = Σ board lengths; board profile rises by z_b − z_a over its run

    Roof faces, gable ends, fascia and soffit res-roof.js
    • BimCraft
    64-bit
  • Soffit area

    Adds up the area of the level soffit panels under the eaves.

    area = Σ |polygon area|

    Roof faces, gable ends, fascia and soffit res-roof.js
    • BimCraft
    64-bit
  • Roof areas and line lengths written to the model

    Writes the roof's sloped area, projected area and the lengths of its ridges, hips, valleys, eaves and rakes.

    GrossArea = plan.area; ProjectedArea = plan.projected; lengths = round(L ÷ unit, 6)

    Roof faces, gable ends, fascia and soffit res-roof.js
    • BimCraft
    64-bit
  • Eave frame of a plane

    Finds the eave direction and the inward direction of a roof plane from its polygon.

    u = (p₁ − p₀) ÷ |p₁ − p₀|; n = (−u_y, u_x), flipped when Σ (p − p₀) · n < 0

    Manual roof planes res-roofplane.js
    • BimCraft
    64-bit
  • Height of the plane at a point

    The height of the plane's underside over a plan point.

    z = base + tan θ × ((p − o) · n)

    Manual roof planes res-roofplane.js
    • BimCraft
    64-bit
  • Polygon area

    The signed plan area of the plane's polygon.

    A = ½ Σ (xᵢ yᵢ₊₁ − yᵢ xᵢ₊₁)

    Manual roof planes res-roofplane.js
    • BimCraft
    64-bit
  • Sloped slab and areas written to the model

    Builds the plane's slab and writes its sloped area, projected area, points, pitch, base and thickness.

    profile y = ((p − o) · n) ÷ cos θ; depth = thickness ÷ cos θ; GrossArea = projected ÷ cos θ

    Manual roof planes res-roofplane.js
    • BimCraft
    64-bit
  • Scale that fits

    Chooses the largest standard scale at which a drawing of a given width and height fits the space on the sheet.

    first ratio with w ÷ r ≤ room_w and h ÷ r ≤ room_h; else r = ⌈max(w ÷ room_w, h ÷ room_h)⌉

    Drawing sheets to scale and the PDF res-sheets.js
    • BimCraft
    64-bit
  • Placing a drawing in its cell

    Centers a drawing in its space on the sheet at the chosen scale and gives the mapping from drawing millimeters to sheet millimeters.

    k = 1 ÷ ratio; sheet = (x + (w − W k) ÷ 2 − x₀ k) + p × k

    Drawing sheets to scale and the PDF res-sheets.js
    • BimCraft
    64-bit
  • A view placed by hand on a sheet

    Works out the scale and the box of a view placed at a given point of a sheet.

    ratio = placed ratio, else the view's own, else the scale that fits a third of the sheet; box = middle ± (W ÷ ratio) ÷ 2

    Drawing sheets to scale and the PDF res-sheets.js
    • BimCraft
    64-bit
  • Arranging the views of a sheet

    Picks one standard scale for all the drawn views of a sheet and packs them in rows.

    first ratio at which every view fits; x, y = round(middle × 10) ÷ 10

    Drawing sheets to scale and the PDF res-sheets.js
    • BimCraft
    64-bit
  • Arcs drawn as chords

    Turns each arc of a plan symbol, such as a door swing, into a polyline for the sheet.

    steps = max(8, ⌈|a₁ − a₀| ÷ (π ÷ 32)⌉)

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

    Formats a path coordinate for the PDF.

    text = Number(v.toFixed(6))

    Drawing sheets to scale and the PDF res-sheets.js
    • BimCraft
    64-bit
  • Widths, text positions and matrices written to the PDF

    Formats line widths, dash lengths, clip rectangles, text sizes and the text matrix for the PDF.

    text = v.toFixed(3), with |v| < 5e-5 written as 0

    Drawing sheets to scale and the PDF res-sheets.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.