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

  • 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
  • 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

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.