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

  • Mean and variance from sums

    The mean and the variance of the mean from per-pixel sums of the samples and of their squares.

    m = Σx ÷ n; s² = max(0, (Σx² − n m²) ÷ (n − 1)); var(mean) = s² ÷ n

    Statistical comparison of rendered pictures compute/parity.js
    • BimCraft
    • ModelCraft
    64-bit
  • Block means

    The mean of each block of pixels and the variance of that mean.

    block mean = Σ means ÷ count; block variance = Σ variances ÷ count²

    Statistical comparison of rendered pictures compute/parity.js
    • BimCraft
    • ModelCraft
    64-bit
  • Two pictures compared

    Whether a test picture agrees with a reference picture.

    z = |μ_t − μ_r| ÷ √(σ²_r + σ²_t + (10⁻⁴ max(1, |μ_r|))²); ok if failed blocks ≤ 1 % and the whole-image z ≤ 4.5

    Statistical comparison of rendered pictures compute/parity.js
    • BimCraft
    • ModelCraft
    64-bit
  • Furnace test

    Whether every block of a test picture has the expected mean within its noise.

    z = |block mean − expected| ÷ √(block variance + (10⁻⁴ max(1, |expected|))²); ok if no block has z > 4.5

    Statistical comparison of rendered pictures compute/parity.js
    • BimCraft
    • ModelCraft
    64-bit
  • Samples read from a block

    Puts the samples of one unpacked block into each channel's picture.

    half: table[16-bit value]; float: the 32-bit value; uint: the 32-bit integer

    OpenEXR and Radiance HDR picture files exr/exr.js
    • BimCraft
    • ModelCraft
    64-bit
  • Table for linear B44 channels

    The table that undoes the logarithmic step of B44 compression for channels marked linear.

    table[x] = half(8 × log(value of x))

    OpenEXR and Radiance HDR picture files exr/exr.js
    • BimCraft
    • ModelCraft
    64-bit
  • Red, green, blue and alpha of a picture

    Gathers a layer's channels into one RGBA picture.

    subsampled channel: sample at (floor(x ÷ xSampling), floor(y ÷ ySampling))

    OpenEXR and Radiance HDR picture files exr/exr.js
    • BimCraft
    • ModelCraft
    64-bit
  • Samples written to a block

    Writes each channel's samples in its type before the block is compressed.

    half: floatToHalf(v); float: nearest 32-bit float; uint: v as a 32-bit unsigned integer

    OpenEXR and Radiance HDR picture files exr/exr.js
    • BimCraft
    • ModelCraft
    64-bit
  • RGBE pixel to a number

    Turns the four bytes of a Radiance pixel into red, green and blue values.

    value = (m + 0.5) × 2^(E − 136); E = 0 gives 0

    OpenEXR and Radiance HDR picture files exr/hdr.js
    • BimCraft
    • ModelCraft
    64-bit
  • Number to an RGBE pixel

    Encodes red, green and blue values as three mantissas and a shared exponent.

    e: 2^(e−1) ≤ max(r, g, b) < 2^e; mantissa = floor(value × 256 ÷ 2^e); E = e + 128

    OpenEXR and Radiance HDR picture files exr/hdr.js
    • BimCraft
    • ModelCraft
    64-bit
  • Distance of a point along the run

    How far along the run's drawn line a point lies, measured from the first point.

    s = Σ earlier leg lengths + clamp((p − a)·d, 0, L)

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Each part's place and center-line length

    The two ends of every pipe, bend and tee along the run, and the part's own center-line length.

    bend: R × θ; tee: 2 × m; straight: |b − a|

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Where the run is cut and where spools break

    The cut positions inside straight pipe and the breaks between spools, from the field welds and the longest spool length.

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Spool length

    The parts of each spool and the spool's total center-line length.

    length = Σ part lengths, in run order

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Cut length of a straight piece

    The length of each straight pipe piece on the spool sheet's cut list.

    length = |b − a|

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Bend angle on the fitting list

    The angle shown for each elbow and the count of like fittings.

    angle = round(θ × 180 ÷ π)

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Pipe length and weight on the bill of materials

    The total cut length of pipe in a spool and its steel weight.

    kg = (kg per m) × Σ cut lengths ÷ 1000

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Duct cut list

    How many stock-length duct pieces each straight duct needs, and the length left over.

    full = floor((L + 0.5) ÷ piece); rest = L − full × piece

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Lengths and weights printed on the spool sheet

    The spool length, cut lengths, pipe length and weight as they appear in the PDF.

    printed kg = round(kg × 10) ÷ 10

    Pipe spools, cut lists and spool sheets mep/spool-sheet.js
    • BimCraft
    64-bit
  • Spool sheet CSV rows

    The cut lengths, quantities and pipe weight exported as CSV.

    exported kg = round(kg × 100) ÷ 100

    Pipe spools, cut lists and spool sheets mep/spool-sheet.js
    • BimCraft
    64-bit
  • Distance from a point to a triangle

    The shortest distance from a point to a triangle, on a corner, an edge or the face.

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    64-bit
  • Segment crossing a triangle

    Where along a straight piece of a run it passes through one triangle of a wall or slab.

    t = (e₂ · (s × e₁)) ÷ (e₁ · (d × e₂))

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    64-bit
  • Clearance between an MEP element and the structure

    The gap reported when a pipe or duct is closer to a structural element than its insulation plus the typed clearance.

    need = (insulation + gap) ÷ 1000; gap = min over vertices p and triangles T of dist(p, T), both ways

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    32-bit in part
  • Run center line as straight pieces

    The center line of a run, part by part, that is tested against walls and slabs.

    bend point k = center + (−n cos(θk ÷ 8) + d₁ sin(θk ÷ 8)) × R, k = 0 … 8

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    64-bit
  • Opening size

    The width and height of the opening a run needs in a wall or slab.

    opening = outside size + 2 × insulation + 2 × gap

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    64-bit
  • Where a run passes through an element

    The position of each opening on the run, its place in plan, and the length of run inside the wall or slab.

    s = s₀ + u × piece length; through = s_leave − s_enter; at = midpoint of the two crossings

    MEP clearances and openings through walls and slabs mep/structure.js
    • BimCraft
    32-bit in part
  • Rounding to three decimals

    The rounding applied to every stored length, spacing and symbol coordinate.

    r3(v) = round(v × 1000) ÷ 1000

    Plant sizes, spacing and symbols plants/plants.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Reading a length

    A height, spread, spacing, volume or girth read from a file, a CSV cell or the editor.

    Plant sizes, spacing and symbols plants/plants.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Sizes, hardiness zone and spacing of one species

    The mature size, planting size, zone range and spacing kept for a species row.

    Plant sizes, spacing and symbols plants/plants.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Default planting size and spacing

    The planting size, container and spacing filled in when a species row leaves them empty.

    spacing = max(q, round(k × spread ÷ q) × q), by plant type

    Plant sizes, spacing and symbols plants/plants.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Spacing from planting density

    The center-to-center spacing that gives a stated number of plants per square meter.

    square: s = 1 ÷ √d; triangular: s = √(2 ÷ (√3 × d))

    Plant sizes, spacing and symbols plants/plants.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Spacing used for a species

    The spacing a bed or hedge is planted at: the species' own, else from its density, else the default.

    Plant sizes, spacing and symbols plants/plants.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Supplied sizes written to CSV

    Container volume, height, spread, girth and clear stem of each supplied size as one CSV cell.

    Plant sizes, spacing and symbols plants/plants.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Supplied sizes read from CSV

    The same cell read back into numbers.

    Plant sizes, spacing and symbols plants/plants.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • 2D planting symbol

    The circles, lines, arcs and outlines of a plant's plan symbol, sized to its spread.

    R = spread ÷ 2 × scale; point = (r cos a, r sin a)

    Plant sizes, spacing and symbols plants/plants.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Library item size

    The width, depth and height of the library item placed for a plant.

    mm = round(m × 1000)

    Plant sizes, spacing and symbols plants/plants.js
    • BimCraft
    • ModelCraft
    • CivilCraft
    64-bit
  • Key times to one millisecond

    The rounding applied to every key time, clip start and the animation length.

    t = round(t × 1000) ÷ 1000

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Stretching an animation to a new length

    Every key time and clip start when the animation is made longer or shorter.

    k = new length ÷ old length; t′ = round₀.₀₀₁(t × k)

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Spreading chosen keys about a time

    The new times of selected keys scaled away from or toward a pivot time.

    t′ = round₀.₀₀₁(pivot + (t − pivot) × f)

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Frame count and frame times

    The number of frames a render of the animation has, and the time of each frame.

    frames = max(1, round(length × fps) + 1); time of frame i = i ÷ fps

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Position between two keys

    Which pair of keys a time falls between and how far along that stretch it is.

    s = (t − tᵢ) ÷ (tᵢ₊₁ − tᵢ)

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Time on a repeating track

    The time inside the keys' span that a repeating, ping-pong or offset track plays at.

    x = (t − t₀) ÷ P; k = floor(x); f = x − k

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Speed through a key

    The rate of change of a value at a key, from its two neighbors.

    m = (pᵢ₊₁ − pᵢ₋₁) ÷ (tᵢ₊₁ − tᵢ₋₁)

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Value between two keys

    A position or other value between two keys: held, straight, or on a smooth curve.

    p = h₀₀ p₀ + h₀₁ p₁ + h₁₀ Δt m₀ + h₁₁ Δt m₁

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Bézier handles of a property key

    The two handle points of a key on a property curve.

    automatic: handle = key ± (Δt ÷ 3, m × Δt ÷ 3)

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Property value on a Bézier curve

    The value of an animated property at a time between two keys with Bézier handles.

    solve x(u) = t by bisection; v = B(v₀, p₁, p₂, v₃; u)

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Property value at a time

    A property track's value at any time, with its cycles followed.

    offset cycle: v + n × (last key − first key)

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Camera at a time

    The camera's eye, target, view angle and view height between camera keys.

    eye, target, fov on the curve; height = exp(curve of ln height)

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Matrix to position, rotation and scale

    A placement matrix split into its position, a unit quaternion and three scale factors.

    s = column lengths; q from the rotation matrix (Shepperd)

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Position, rotation and scale to matrix

    The placement matrix built from a position, a quaternion and a scale.

    Animation keys, curves and poses render/anim.js
    • BimCraft
    • ModelCraft
    • PartCraft
    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.