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

  • Room quantities

    Height, perimeters, floor areas and volume of a room.

    h = elevation above − elevation; gross area = |shoelace(outline)|; volume = net area × h

    Room, floor and ceiling quantities model-slabs.js
    • BimCraft
    64-bit
  • Floor slab quantities

    Thickness, perimeter, areas and volume of a floor slab.

    net area = |A(outline)| − Σ |A(hole)|; volume = net area × thickness; solid from offset − thickness, depth = thickness

    Room, floor and ceiling quantities model-slabs.js
    • BimCraft
    64-bit
  • Ceiling quantities

    Thickness and areas of a ceiling.

    net area = |A(outline)| − Σ |A(hole)|

    Room, floor and ceiling quantities model-slabs.js
    • BimCraft
    64-bit
  • Change key of a shape

    A short key of what a shape was made from, used to decide whether to write it again.

    numbers rounded to 0.01 mm → text → 32-bit FNV-1a hash + text length

    Room, floor and ceiling quantities model-slabs.js
    • BimCraft
    64-bit
  • Height a roof sits at

    The top of the tallest wall under a roof.

    top = max(base offset + height) over the walls, else the level's height

    Room, floor and ceiling quantities model-slabs.js
    • BimCraft
    64-bit
  • Default roof sizes

    The pitch, overhang and thickness a new roof gets when none are given.

    pitch = 26.565°; overhang = 12 × 25.4 mm; thickness = 8 × 25.4 mm

    Room, floor and ceiling quantities model-slabs.js
    • BimCraft
    64-bit
  • Point along a snapped direction

    The point at an orthogonal or stepped angle from the last point, stopping at a wall it crosses or at a rounded length.

    θ = round(θ ÷ step) × step; l = len × cos(θ₀ − θ); p = from + l × (cos θ, sin θ)

    Drawn points: angle, length and wall-face paths model-tools.js
    • BimCraft
    64-bit
  • Nearest point on a wall line or face

    The point on a wall's center line or face nearest the pointer.

    s = clamp((p − a)·u, 0, L); q = a + s·u

    Drawn points: angle, length and wall-face paths model-tools.js
    • BimCraft
    64-bit
  • Signed area of a drawn loop

    The signed area of a closed chain of points, used to tell which side is outside.

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

    Drawn points: angle, length and wall-face paths model-tools.js
    • BimCraft
    64-bit
  • Center lines for a path drawn on a wall face

    Offsets a drawn path by half the wall thickness and mitres the corners.

    offset = ± t ÷ 2 along the left normal; corner = intersection of neighboring offset lines

    Drawn points: angle, length and wall-face paths model-tools.js
    • BimCraft
    64-bit
  • Where two center lines meet

    The meeting point of line a→b and line c→d, with its position along each.

    den = r × s; t = ((c − a) × s) ÷ den; u = ((c − a) × r) ÷ den; p = a + t·r

    Trim, extend and corner walls model-trim.js
    • BimCraft
    64-bit
  • New ends of a trimmed wall

    Which part of the wall stays and where its moved end goes.

    inside when 0.5 ÷ L < t < 1 − 0.5 ÷ L; click side by t_c = (click − a)·(b − a) ÷ L²

    Trim, extend and corner walls model-trim.js
    • BimCraft
    64-bit
  • Trim or extend to a wall

    A wall's new ends when it is trimmed or extended to another wall.

    allowed when −slack ≤ u ≤ 1 + slack, slack = (t_edge ÷ 2) ÷ L_edge

    Trim, extend and corner walls model-trim.js
    • BimCraft
    64-bit
  • Corner two walls

    Both walls' new ends at the point their center lines meet.

    Trim, extend and corner walls model-trim.js
    • BimCraft
    64-bit
  • Whether a trim cuts through an opening

    Checks each door and window on the wall against the wall's new extent.

    s₀ = offset − shift, s₁ = s₀ + width; cut when the opening is not wholly outside and s₀ < −0.5 or s₁ > L + 0.5

    Trim, extend and corner walls model-trim.js
    • BimCraft
    64-bit
  • Drawing units to millimeters

    The factor that turns drawing units into millimeters, by the drawing's INSUNITS code.

    1 → 25.4, 2 → 304.8, 4 → 1, 5 → 10, 6 → 1000, 10 → 914.4

    Walls and openings traced from a drawing model-trace.js
    • BimCraft
    Exact
  • Extents of a block

    The bounding box of a block's lines, polylines, circles, arcs and nested blocks.

    arc: its two ends and every quarter point k × π ÷ 2 inside the sweep

    Walls and openings traced from a drawing model-trace.js
    • BimCraft
    64-bit
  • Box of a placed block

    The box of a block reference in plan millimeters.

    corner = (insert + R(rotation) · (scale · block corner)) × unit; box = min and max of the four corners

    Walls and openings traced from a drawing model-trace.js
    • BimCraft
    64-bit
  • Joining lines into chains

    Links line segments that share an end point into chains.

    key = round(x ÷ tol), round(y ÷ tol)

    Walls and openings traced from a drawing model-trace.js
    • BimCraft
    64-bit
  • Chain offset to the wall's center line

    Moves a chain of face lines sideways by half the wall thickness, with mitred corners.

    n = (−Δy, Δx) ÷ L × d; corner = axisMeet of neighboring offset lines

    Walls and openings traced from a drawing model-trace.js
    • BimCraft
    64-bit
  • Walls from pairs of parallel lines

    Pairs two parallel lines as the faces of a wall and gives its center line and thickness.

    d = (q.a − p.a)·n; overlap = [max(0, min(s₀, s₁)), min(L, max(s₀, s₁))]; center line = p + (d ÷ 2)·n over the overlap; t = |d|

    Walls and openings traced from a drawing model-trace.js
    • BimCraft
    64-bit
  • Closing traced corners

    Runs a wall end that stops short of another wall to that wall's center line.

    gap = |end − meeting point| ≤ 0.75 × max(t₁, t₂) + 1 mm

    Walls and openings traced from a drawing model-trace.js
    • BimCraft
    64-bit
  • Doors and windows from blocks

    Places a door or window on the wall nearest a block's box, with its offset and width along the wall.

    s = (c − a)·u; width = |Δx·uₓ| + |Δy·u_y| of the box, between 400 mm and L − 50 mm; offset = s − width ÷ 2

    Walls and openings traced from a drawing model-trace.js
    • BimCraft
    64-bit
  • Wall type for a traced thickness

    Chooses the wall type for a traced wall from its measured thickness.

    |t − t₀| > 1 mm → type at Math.round(t) mm, else the chosen type

    Walls and openings traced from a drawing model-trace.js
    • BimCraft
    64-bit
  • Underlay line points

    The points of the reference drawing stored with the level.

    round(mm ÷ unit, 6)

    Walls and openings traced from a drawing model-trace.js
    • BimCraft
    64-bit
  • Typed length to millimeters

    Reads a typed length in feet and inches, inches with a fraction, or any unit mark, as millimeters.

    mm = sign × (|feet| × 12 + inches + n ÷ d) × 25.4

    Typed lengths, angles and pitches model-units.js
    • BimCraft
    Exact
  • Typed point, step or polar entry

    Reads a relative step, an absolute point, a length at an angle, or a bare length from the keyboard.

    Typed lengths, angles and pitches model-units.js
    • BimCraft
    Exact
  • Typed roof pitch to degrees

    Reads a pitch typed as a rise over a run, or in degrees.

    degrees = atan(rise ÷ run) × 180 ÷ π

    Typed lengths, angles and pitches model-units.js
    • BimCraft
    64-bit
  • Area as text

    Formats square millimeters as m² or ft² for labels.

    m² = round(mm² ÷ 10⁴) ÷ 100; ft² = round(mm² ÷ 304.8² × 10) ÷ 10

    Typed lengths, angles and pitches model-units.js
    • BimCraft
    64-bit
  • Pitch as text

    Formats a pitch in degrees as a rise in 12, or as degrees.

    rise = round(tan(θ) × 12 × 4) ÷ 4

    Typed lengths, angles and pitches model-units.js
    • BimCraft
    64-bit
  • Angle as text

    Formats an angle in degrees, wrapped to 0 to 360.

    a = round(((deg mod 360) + 360) mod 360 × 10) ÷ 10

    Typed lengths, angles and pitches model-units.js
    • BimCraft
    64-bit
  • Next point from a typed entry

    The plan point for a typed absolute point, relative step, length at an angle, or length along the pointer's direction; and a door or window offset from a typed distance.

    relative: q = last + (dx, dy); polar: q = last + len × (cos θ, sin θ), θ = degrees × π ÷ 180; along the pointer: q = last + len × (to − last) ÷ |to − last|

    Typed points and door or window positions model-ui.js
    • BimCraft
    64-bit
  • Door or window position from the pointer

    The wall under the pointer and the offset of an opening centered on it.

    s = (p − a)·u; offset = s − width ÷ 2, then (L − width) ÷ 2 near the middle, else round(offset ÷ step) × step

    Typed points and door or window positions model-ui.js
    • BimCraft
    64-bit
  • Mode frequencies of a box room

    Every standing-wave frequency of a rigid box up to a top frequency, with its kind.

    f = c ÷ 2 × √((i ÷ L_x)² + (j ÷ L_y)² + (k ÷ L_z)²), c = 343 m/s

    Room modes and low-frequency wave solver modes.js
    • BimCraft
    64-bit
  • Schroeder frequency

    The frequency below which the sound field is separate modes, from reverberation time and volume.

    f_S = 2000 × √(T ÷ V)

    Room modes and low-frequency wave solver modes.js
    • BimCraft
    64-bit
  • Smallest gap between modes

    The smallest difference between neighboring mode frequencies below a limit.

    min(fᵢ − fᵢ₋₁)

    Room modes and low-frequency wave solver modes.js
    • BimCraft
    64-bit
  • Wave simulation of a box room

    The pressure over time at a listener after a pulse at a source, and its spectrum.

    pⁿ⁺¹ = damp × (2pⁿ − pⁿ⁻¹) + Σ_axes (c·Δt ÷ Δ)² × (p₋ + p₊ − 2pⁿ); Δt = 0.9 × Δ_min ÷ (c √3)

    Room modes and low-frequency wave solver modes.js
    • BimCraft
    32-bit in part
  • Resonance peaks of the spectrum

    The frequencies and sizes of the local maxima of the spectrum.

    offset = ½ (y₀ − y₂) ÷ (y₀ − 2y₁ + y₂); f = (i + offset) × Δf

    Room modes and low-frequency wave solver modes.js
    • BimCraft
    32-bit in part
  • Number format in the file

    Turns a number into the text written in the PDF.

    toFixed(4), trailing zeros removed; |v| < 5e-5 → 0

    Vector PDF output pdf.js
    • BimCraft
    • DetailCraft
    64-bit
  • Millimeters to points

    The factor between millimeters and PDF points.

    K = 72 ÷ 25.4

    Vector PDF output pdf.js
    • BimCraft
    • DetailCraft
    Exact
  • Page scale matrix

    The matrix that lets the rest of the page be written in millimeters.

    [K 0 0 K 0 0] with K written as num(K) = 2.8346

    Vector PDF output pdf.js
    • BimCraft
    • DetailCraft
    64-bit
  • Page size in points

    The page box from the sheet size in millimeters.

    points = num(mm × K)

    Vector PDF output pdf.js
    • BimCraft
    • DetailCraft
    64-bit
  • Circle as four curves

    A circle written as four cubic Bézier curves.

    control distance k = 0.5522847498 × r

    Vector PDF output pdf.js
    • BimCraft
    • DetailCraft
    64-bit
  • Text position and matrix

    Where a text starts and how it is turned and sized.

    x = x₀ + dx·cos θ, y = y₀ + dx·sin θ; matrix = [h·cos θ, h·sin θ, −h·sin θ, h·cos θ, x, y]

    Vector PDF output pdf.js
    • BimCraft
    • DetailCraft
    64-bit
  • Room grid

    Covers a room with square cells and marks the ones whose center is inside it.

    cell × 1.5 while (W ÷ cell + 1) × (H ÷ cell + 1) > 60000

    People movement and travel distance people-sim.js
    • BimCraft
    64-bit
  • Distance field over a room

    The walked distance from one cell to every other free cell of a room.

    d(n) = min over 16 neighbors of d(c) + √(Δi² + Δj²) × cell

    People movement and travel distance people-sim.js
    • BimCraft
    64-bit
  • Route between two places in a room

    The distance in meters between two points of a room and the path walked.

    straight: √(Δx² + Δy²) ÷ 1000; else Σ segment lengths of the string-pulled path ÷ 1000

    People movement and travel distance people-sim.js
    • BimCraft
    64-bit
  • Distance to the goal from every opening

    The remaining walking distance to an exit, or to a room, from each side of each door and stair.

    d(far side of j) = min(d(i) + walk(j → i) + length of opening j)

    People movement and travel distance people-sim.js
    • BimCraft
    64-bit
  • Travel distance of each room

    The farthest point of each room from an exit, in meters along the walls.

    max over cells and corners of min over openings (distance to opening + distance beyond it); rounded to 0.01 m

    People movement and travel distance people-sim.js
    • BimCraft
    64-bit
  • Speed factor from crowd density

    How much the crowd in a room slows a walker.

    D = people ÷ max(area, 0.5); factor = 1 for D ≤ 0.54, else max(min factor, (1 − 0.266·D) ÷ (1 − 0.266 × 0.54))

    People movement and travel distance people-sim.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.