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

  • Smallest rectangle round a wall's plan points

    The minimum-area bounding rectangle of a set of plan points.

    for each hull edge direction u: area = (max u − min u) × (max v − min v); keep the smallest

    Wall faces and plan frames from element meshes ifc-place.js
    • BimCraft
    64-bit
  • Snapping an item to the nearest wall face

    The position and rotation that put an item's back against the nearest wall face.

    t = clamp((p − a)·(b − a) ÷ |b − a|², 0, 1); q = a + t (b − a); position = q + n × maxY; rot = atan2(−n_y, −n_x) − 90°

    Wall faces and plan frames from element meshes ifc-place.js
    • BimCraft
    32-bit in part
  • Plan frame of copied elements

    The turn of the first copied element and the box of all copied meshes measured in those turned axes.

    rot = atan2(W[1], W[0]) in degrees, rounded to 6 decimals; box from orientedBox

    Wall faces and plan frames from element meshes ifc-place.js
    • BimCraft
    32-bit in part
  • Box of points in turned plan axes

    The bounds of a point list in plan axes turned by an angle, and the box center in model millimeters.

    u = x cos r + y sin r; v = −x sin r + y cos r; center = ((u₀ + u₁) ÷ 2, (v₀ + v₁) ÷ 2) turned back

    Wall faces and plan frames from element meshes ifc-place.js
    • BimCraft
    64-bit
  • Reading WAV samples

    The first channel of a WAV file as numbers between −1 and 1.

    x = sample ÷ 2^(bits − 1)

    Room acoustic measures from an impulse response metrics.js
    • BimCraft
    32-bit in part
  • Decay time from a line fit

    A decay time from the slope of the least-squares line through part of the decay curve.

    slope = (m Σ t d − Σ t Σ d) ÷ (m Σ t² − (Σ t)²); T = 60 ÷ −slope

    Room acoustic measures from an impulse response metrics.js
    • BimCraft
    64-bit
  • Decay curve, clarity, definition and center time

    The energy decay curve and the measures read from it.

    curve = 10 lg(∫ₜ p² ÷ ∫₀ p²); C = 10 lg(early ÷ late); D50 = early ÷ total; Ts = Σ t p² ÷ Σ p²

    Room acoustic measures from an impulse response metrics.js
    • BimCraft
    64-bit
  • Predicted against measured

    The difference between a predicted and a measured value in each band, against the just-noticeable difference.

    within when |predicted − measured| ≤ JND

    Room acoustic measures from an impulse response metrics.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
  • Resampling the chosen part of the photo

    Averages the chosen part of the photo down, or interpolates it up, to the tile size.

    Material maps and statistics from a photo photo-material.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Normal map from the height estimate

    The surface direction at each pixel of the tile.

    v = (−Δh_x × S, −Δh_y × S, 1) ÷ |v|, S = 4 × bump; stored as (v ÷ 2 + ½) × 255

    Material maps and statistics from a photo photo-material.js
    • BimCraft
    • ModelCraft
    32-bit, display only
  • Seam ratio

    How big the jump across the tile's join is compared with the usual jump between neighboring pixels.

    ratio = mean |jump across the join| ÷ max(mean |jump between neighbors|, 1e-6)

    Material maps and statistics from a photo photo-material.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Statistics returned with the maps

    The crop, seam ratios, mean color, height spread and mean roughness reported for the material.

    σ = √(Σ band² ÷ n); seam and σ rounded to 0.01, mean roughness to 0.001, crop to 0.001

    Material maps and statistics from a photo photo-material.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • Site position and time zone

    The latitude, longitude, north direction and time zone used for the sun.

    time zone = round(longitude ÷ 15) unless given

    Solar arrays on the model pv-calc.js
    • BimCraft
    64-bit
  • Model triangles in millimeters

    Every placed triangle of the model that can shade or carry modules.

    mm = mesh position × unit in mm

    Solar arrays on the model pv-calc.js
    • BimCraft
    32-bit in part
  • Array tilt and power

    The tilt, azimuth and peak power recorded for a planned array.

    tilt = acos(clamp(n_z, −1, 1)) × 180 ÷ π; kWp = modules × Wp ÷ 1000

    Solar arrays on the model pv-calc.js
    • BimCraft
    64-bit
  • Array definition stored in the file

    The text that records an array's plane, module size and module centers.

    normal, u, v: round to 1e-6; module centers and table corners: round to 0.1 mm

    Solar arrays on the model pv-calc.js
    • BimCraft
    64-bit
  • Arrays read back from the file

    Rebuilds each array's modules and corners from its stored definition.

    corner = c ± u × across ÷ 2 ± v × along ÷ 2

    Solar arrays on the model pv-calc.js
    • BimCraft
    64-bit
  • Module frames in the level's axes

    Turns module centers and the array's directions from model axes into the level's own axes for the stored solids.

    point′ = S⁻¹ · p; direction′ = S⁻¹ · d − S⁻¹ · 0

    Solar arrays on the model pv-calc.js
    • BimCraft
    64-bit
  • Shade fraction of an array

    The shaded share of each array for every month and hour.

    fraction = Σ (table fraction × table samples) ÷ Σ samples

    Solar arrays on the model pv-calc.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
  • Model triangles in plan millimeters

    Collects every element's triangles from the loaded model and converts them from viewer meters to plan millimeters.

    p′ = M × (x, y, z, 1)

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    32-bit in part
  • Projection and section cut

    Projects each triangle into view coordinates and finds where the section plane cuts it.

    x = p · right; y = z; depth = p · dir; cut point = a + (b − a) × (c₀ − d_a) ÷ (d_b − d_a)

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Triangle clipped at a depth

    Keeps the part of a triangle behind the section plane, or in front of the far limit.

    f = (d₀ − d_a) ÷ (d_b − d_a); new vertex = a + (b − a) × f

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Depth buffer and the visibility test

    Rasterizes every triangle's depth onto a pixel grid and tests whether an edge sample is covered.

    s = 1600 ÷ max(W, H); visible when d ≤ nearest depth in 3 × 3 pixels + tol; tol = max(3, 0.002 × depth range, 4 ÷ s)

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Triangle depth on the pixel grid

    Writes a triangle's depth into each pixel whose center it covers, keeping the nearest.

    d = w₀ d_a + w₁ d_b + w₂ d_c at the pixel center, barycentric weights

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    32-bit, display only
  • Visible runs of an edge

    Samples each feature edge and keeps the stretches that are visible as drawn lines.

    n = max(1, ⌈edge length in pixels ÷ 0.75⌉); samples at a + (b − a) × k ÷ n

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Boundary and crease edges

    Finds the edges of an element's triangles that are open boundaries or creases sharper than 25 degrees.

    crease when |n₁ · n₂| < cos 25°; vertices matched by round(2 × coordinate)

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Cut segments joined into loops

    Joins the segments where the section plane cuts an element into the closed outlines that are filled.

    ends matched by round(2 × coordinate)

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Line cut to the view's frame

    Cuts a drawn line to the view's box.

    Liang–Barsky: t₀, t₁ from q ÷ p on each side

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Cut outline cut to the view's frame

    Cuts a filled section outline to the view's box.

    Sutherland–Hodgman against the four sides

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Collinear pieces joined

    Joins touching pieces of the same element's lines that run in the same direction into one line.

    join when ends ≤ 0.5 mm apart and cos(angle) ≥ 0.99999

    Elevations and sections with hidden lines removed res-views.js
    • BimCraft
    64-bit
  • Scan points into the model's space

    Moves every scan point through the cloud's placement matrix into the model's space.

    p′ = M × (x, y, z, 1), stored in a Float32Array

    Scan compared with the model scan-progress.js
    • BimCraft
    32-bit in part
  • Signed distance of a point from a box

    The distance from a scan point to an element's box surface, positive outside and negative inside, and the running sums for the mean and RMS.

    outside: d = √Σ gapₖ²; inside: d = −min distance to a face

    Scan compared with the model scan-progress.js
    • BimCraft
    32-bit in part
  • Coverage, state and deviation of an element

    An element's covered share, its state, and the mean offset and RMS of the scan from its surface.

    coverage = max over large faces of covered cells ÷ cells; mean = Σd ÷ n; rms = √(Σd² ÷ n)

    Scan compared with the model scan-progress.js
    • BimCraft
    32-bit in part
  • Percent complete

    The share of judged elements that are built, by count and by box volume.

    pct = round(1000 × built ÷ judged) ÷ 10; by volume: round(1000 × V_built ÷ V_judged) ÷ 10

    Scan compared with the model scan-progress.js
    • BimCraft
    64-bit
  • Progress report as CSV

    Writes one row per element with its state, coverage, mean offset, RMS, point count and volume.

    coverage: 3 decimals; mean, rms, volume: 4 decimals

    Scan compared with the model scan-progress.js
    • BimCraft
    32-bit in part
  • Slice turned square

    Turns the slice's points by the walls' angle so that every wall runs along one of two axes.

    u = x cos(−α) − y sin(−α); v = x sin(−α) + y cos(−α)

    Walls, doors and rooms proposed from a scan scan-walls.js
    • BimCraft
    64-bit
  • Wall line from a histogram peak

    Finds where a wall lies across its direction: a peak in the histogram of the points, then the mean of the points in that peak.

    peak: h_b ≥ h_b₋₁, h_b > h_b₊₁, three-cell sum ≥ 2 × minimum points; position = mean of the points in the three cells

    Walls, doors and rooms proposed from a scan scan-walls.js
    • BimCraft
    64-bit
  • Wall runs and their ends

    Splits the points on a wall line into runs and keeps the runs that are long, thin and denser than what lies beside them.

    split at gaps > 450 mm; keep when length ≥ 800 mm, min(side counts) ≤ 0.25 × count, core density ≥ 3 × side density

    Walls, doors and rooms proposed from a scan scan-walls.js
    • BimCraft
    64-bit
  • Door gaps

    Finds a door where two wall runs on one line are a door's width apart.

    gap = second.from − first.to; door when 600 ≤ gap ≤ 1300; width = Math.round(gap)

    Walls, doors and rooms proposed from a scan scan-walls.js
    • BimCraft
    64-bit
  • Plan slice of a scanned mesh

    Finds where a horizontal plane cuts each triangle of a mesh and samples points along the cut.

    f = (z_cut − z_a) ÷ (z_b − z_a); samples every 20 mm along each cut segment

    Walls, doors and rooms proposed from a scan scan-propose.js
    • BimCraft
    64-bit
  • Plan slice of a point cloud

    Takes the cloud's points in a band above the floor as the plan slice, in millimeters from the cloud's origin.

    k = 304.8 for feet, 304.8006 for US survey feet, 1000 otherwise

    Walls, doors and rooms proposed from a scan scan-propose.js
    • BimCraft
    32-bit in part

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.