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.
Calculations
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.jsExact- BimCraft
-
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.jsExact- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js32-bit in part- BimCraft
-
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.js32-bit in part- BimCraft
-
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.js64-bit- BimCraft
- DetailCraft
-
Millimeters to points
The factor between millimeters and PDF points.
K = 72 ÷ 25.4
Vector PDF output pdf.jsExact- BimCraft
- DetailCraft
-
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.js64-bit- BimCraft
- DetailCraft
-
Page size in points
The page box from the sheet size in millimeters.
points = num(mm × K)
Vector PDF output pdf.js64-bit- BimCraft
- DetailCraft
-
Circle as four curves
A circle written as four cubic Bézier curves.
control distance k = 0.5522847498 × r
Vector PDF output pdf.js64-bit- BimCraft
- DetailCraft
-
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.js64-bit- BimCraft
- DetailCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
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.js64-bit- BimCraft
-
Flow rate of an opening
How many people per second a door or stair lets through.
rate = flow per meter × max(0.2, width ÷ 1000 − 2 × boundary)
People movement and travel distance people-sim.js64-bit- BimCraft
-
Walking step
How far a walker moves in one time step and the distance added to their total.
Δs = v₀ × factor × Δt; walked += min(Δs, remaining length of the leg)
People movement and travel distance people-sim.js64-bit- BimCraft
-
Passing an opening
The moment each queued person passes a door or stair, and their wait.
pass = max(next free, arrival, t) + counter-flow penalty; next free = pass + 1 ÷ rate; wait = pass − arrival
People movement and travel distance people-sim.js64-bit- BimCraft
-
Reported times and distances
Total time, median and 90th percentile times, walked distances and waits.
percentile p = times[ceil(n·p) − 1]; times rounded to 0.1 s, distances to 0.01 m
People movement and travel distance people-sim.js64-bit- BimCraft
-
Stair length
The walked length of a stair from its plan walk line and its height.
length = √(plan length² + height²)
People movement and travel distance people-model.js64-bit- BimCraft
-
People per room
How many people each room holds before a run.
count = floor(area in m² ÷ m² per person)
People movement and travel distance people-model.js64-bit- BimCraft
-
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.js32-bit, display only- BimCraft
- ModelCraft
-
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.js32-bit, display only- BimCraft
- ModelCraft
-
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.js32-bit in part- BimCraft
- ModelCraft
-
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.js32-bit in part- BimCraft
- ModelCraft
-
Rounding of stored picture values
Rounds a position, scale or angle to 6 decimals.
r6(v) = Math.round(v × 10⁶) ÷ 10⁶
Picture backgrounds: scale, placement and print picture.js64-bit- BimCraft
-
New picture record
The cleaned numbers of a picture, with defaults.
default scale = r6(20000 ÷ width in pixels); angle = r6(((a mod 360) + 360) mod 360)
Picture backgrounds: scale, placement and print picture.js64-bit- BimCraft
-
Scale by two points and a distance
The new scale and center that make two picked points a given distance apart.
k = mm ÷ |b − a|; scale′ = r6(scale × k); center′ = r6(a + (center − a) × k)
Picture backgrounds: scale, placement and print picture.js64-bit- BimCraft
-
Corners of a placed picture
The four corners of the picture in plan millimeters.
corner = center + R(θ) · (± w·scale ÷ 2, ± h·scale ÷ 2), θ = angle × π ÷ 180
Picture backgrounds: scale, placement and print picture.js64-bit- BimCraft
-
Pixel to plan matrix
The transform from picture pixels to plan millimeters.
[k·c, k·s, k·s, −k·c, x + k(−w/2·c − h/2·s), y + k(−w/2·s + h/2·c)]
Picture backgrounds: scale, placement and print picture.js64-bit- BimCraft
-
Plan point to picture pixel
The pixel of the picture under a plan point.
(u, v) = (R(−θ)·(q − center)) ÷ scale; pixel = (u + w ÷ 2, h ÷ 2 − v)
Picture backgrounds: scale, placement and print picture.js64-bit- BimCraft
-
Picture on a vertical plane
Puts a picture on the plane standing over a line, as wide as the line.
k = L ÷ w; center = (L ÷ 2, h·k ÷ 2)
Picture backgrounds: scale, placement and print picture.js64-bit- BimCraft
-
Picture width typed
The scale that makes the picture a typed width.
scale = r6(mm ÷ w)
Picture backgrounds: scale, placement and print picture.js64-bit- BimCraft
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.