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
-
A saved alignment applied
A model point moved to the site by the alignment kept in the file.
(x′, z′) = (x cos yaw − z sin yaw + t_x, x sin yaw + z cos yaw + t_z)
AR on site: lining the model up with the building xr/xr-core.js64-bit- BimCraft
- ModelCraft
-
Re-check on a later visit
How far the first reference point is from where the saved alignment puts it, and what to do about it.
offset = √(Δx² + Δz²); keep < 0.05 m ≤ move < 0.5 m ≤ align again
AR on site: lining the model up with the building xr/xr-core.js64-bit- BimCraft
- ModelCraft
-
Placing a reference point
Takes the site point under the phone's center mark and runs the fit or the re-check with it.
t_y = (w₁_y + w₂_y) ÷ 2 − (m₁_y + m₂_y) ÷ 2
AR on site: lining the model up with the building xr/xr-session.js64-bit- BimCraft
- ModelCraft
-
Camera jitter per pass
Moves the camera by less than a pixel each pass so that the sum of passes is anti-aliased.
j_x = (h₂(i) − ½) × 2 ÷ w; rows 0 and 1 of the projection += j × row 3
Rendered pictures render/render-core.js32-bit, display only- BimCraft
- ModelCraft
-
Section cut for the path tracer
Clips every triangle of the scene against the section planes before the picture is traced.
new corner = a + (b − a) × d_a ÷ (d_a − d_b)
Rendered pictures render/render-pt.js32-bit, display only- BimCraft
- ModelCraft
-
Tiling fractal noise
The noise value behind the library's brick, wood, stone and concrete textures.
Σ ampₒ × noise(u fₒ, v fₒ) ÷ Σ ampₒ, f doubling and amp × gain per octave
Rendered pictures render/textures.js32-bit, display only- BimCraft
- ModelCraft
-
Normal map bytes
Turns a baked material's normal layer into the texture three.js reads.
x = (byte − 128) ÷ 127; z = √(1 − x² − y²); out = (x ÷ 2 + ½) × 255
Rendered pictures render/three-mats.js32-bit, display only- BimCraft
- ModelCraft
-
Average and largest sample count
The two numbers the render dialog states after an adaptive render.
avg = round(10 × Σ nᵢ ÷ (w × h)) ÷ 10; max = largest nᵢ
Samples per pixel reported after a render render/render-pt.js32-bit in part- BimCraft
- ModelCraft
-
Probe light as spherical harmonics
Sums a small traced panorama into the four coefficients per color the view shades with.
c = Σ L × Y × dΩ, dΩ = (2π ÷ w)(π ÷ h) sin θ
Real-time view rt/rt-probes.js32-bit, display only- BimCraft
- ModelCraft
-
Cube faces to a 360° picture
Builds the equirectangular panorama from six rendered faces.
direction from (longitude, latitude); face = largest d·a; color = bilinear mix of four pixels
Real-time view rt/rt-pano.js32-bit, display only- BimCraft
- ModelCraft
-
Display chain for one pixel
Turns a linear color into the color shown: white balance, exposure, highlight knee, contrast, view transform.
c ← max(0, WB c) × 2^stops; c ← 0.18 × (c ÷ 0.18)^(1 + contrast)
Real-time view rt/rt-look.js32-bit, display only- BimCraft
- ModelCraft
-
Standing and falling in walk mode
Keeps the walker's eye at eye height above the floor below, stepping up or falling as the floor changes.
v ← v − 9.81 Δt; height ← max(floor + eye height, height + v Δt)
Real-time view rt/rt-walk.js32-bit, display only- BimCraft
- ModelCraft
-
Target area and the count asked for
The area of the faces a scatter set covers and the number of items its density asks for.
area = Σ ½ |e₁ × e₂|; asked = min(2,000,000, round(area × density)); paint: Σ max(1, round(π r² × density))
Scattered plants, rocks and people: how many and where rt/rt-scatter.js64-bit- BimCraft
- ModelCraft
-
A random point on the target
Picks a triangle in proportion to its area and a point inside it.
P = A + a (B − A) + b (C − A), (a, b) reflected when a + b > 1
Scattered plants, rocks and people: how many and where rt/rt-scatter.js64-bit- BimCraft
- ModelCraft
-
Dropping a point onto the target
Where a vertical ray from a brush dab meets a target triangle.
t = (e₂·q) ÷ det, det = e₁·(d × e₂)
Scattered plants, rocks and people: how many and where rt/rt-scatter.js64-bit- BimCraft
- ModelCraft
-
Slope and height limits
Drops a candidate that stands on too steep a face or outside the height range.
keep when n·up ≥ cos(slope) − 1e-9 and min ≤ p·up ≤ max
Scattered plants, rocks and people: how many and where rt/rt-scatter.js64-bit- BimCraft
- ModelCraft
-
Values to texture bytes
Stores a value from 0 to 1, or a normal component from −1 to 1, as one byte of a texture layer.
byte = ⌊255 x + ½⌋; normal byte = ⌊127 x + 128.5⌋
Material graphs baked to textures shading/bake.js32-bit, display only- BimCraft
- ModelCraft
-
Tiling value noise
The smooth noise that procedural textures are built from.
a + (b − a) f_x + (c − a) f_y + (a − b − c + d) f_x f_y, f = t² (3 − 2t)
Material graphs baked to textures shading/lib.js32-bit, display only- BimCraft
- ModelCraft
-
Ambient occlusion of a texel
The share of directions above a surface point that are not blocked nearby.
open ÷ rays, directions (√u₁ cos 2πu₂, √u₁ sin 2πu₂, √(1 − u₁)) about the normal
Material graphs baked to textures shading/texbake-job.js32-bit, display only- BimCraft
- ModelCraft
-
Decal geometry
The triangles under a decal, clipped to its box and lifted off the surface.
corner = o + x u + y v + z n + 0.0005 × face normal
Material graphs baked to textures shading/decal.js32-bit, display only- BimCraft
- ModelCraft
-
A number as written to the file
The text of every numeric value in the exported file.
text = round(x × 10⁶) ÷ 10⁶
MaterialX files: numbers written and read shading/mtlx.js64-bit- BimCraft
- ModelCraft
-
Tile size as uvtiling
The repeat of every texture in the file, from the material's tile size in meters.
uvtiling = round(10⁶ ÷ size) ÷ 10⁶
MaterialX files: numbers written and read shading/mtlx.js64-bit- BimCraft
- ModelCraft
-
Shader parameters
The constant inputs of the surface shader written to the file.
Standard Surface: emission = luminance × 0.02; thin film thickness × 1000
MaterialX files: numbers written and read shading/mtlx.js64-bit- BimCraft
- ModelCraft
-
Displacement height range
The lowest height and the span of the height map, which set the displacement texture's levels and the scale written to the file.
span = max h − min h; level = round(255 (h − min h) ÷ span); scale = displacement scale × span
MaterialX files: numbers written and read shading/mtlx.js32-bit in part- BimCraft
- ModelCraft
-
Displacement scale written
The scale input of the displacement shader in the exported file.
scale = round(10⁶ × displacement scale × span) ÷ 10⁶
MaterialX files: numbers written and read shading/mtlx.js32-bit in part- BimCraft
- ModelCraft
-
A value read from the file
The number or list of numbers in a value attribute.
MaterialX files: numbers written and read shading/mtlx.js64-bit- BimCraft
- ModelCraft
-
Unit changes on reading
Standard Surface values converted to the app's units.
thin film thickness ÷ 1000; emission ÷ 0.02; opacity = (r + g + b) ÷ 3
MaterialX files: numbers written and read shading/mtlx.js64-bit- BimCraft
- ModelCraft
-
Tile size from uvtiling
The material's tile size in meters from the uvtiling shared by a file's images.
width = 1 ÷ tiling_u; height = 1 ÷ tiling_v
MaterialX files: numbers written and read shading/mtlx.js64-bit- BimCraft
- ModelCraft
-
Mean of an input that varies over the tile
The single value given to a shader input the renderers and the file cannot vary across the surface.
mean = Σ f(uᵢ, vⱼ) ÷ 64², a 64 × 64 grid of texel centers
MaterialX files: numbers written and read shading/bake.js64-bit- BimCraft
- ModelCraft
-
Rounding of spoken numbers and angles
Turns a number or an angle into the short text that is spoken.
num(v) = round(v × 100) ÷ 100; deg(θ) = num(round(normAngle(θ) × (180 ÷ π) × 100) ÷ 100)
Spoken lengths, directions and extents access.js64-bit- CadCraft
-
Direction as one of eight words
Which of the eight directions (right, up-right, up and so on) leads from one point to another.
index = round(atan2(Δy, Δx) ÷ (π ÷ 4)) mod 8
Spoken lengths, directions and extents access.js64-bit- CadCraft
-
A move in words
The distance, angle and the two components of a move from one point to another.
d = √(Δx² + Δy²); angle = atan2(Δy, Δx)
Spoken lengths, directions and extents access.js64-bit- CadCraft
-
Length along an object
The length of a line, circle, arc or polyline that is read out with the object.
line: √(Δx² + Δy²); circle: 2πr; arc: r × ((a₁ − a₀) mod 2π); polyline: Σ |pᵢ₊₁ − pᵢ|
Spoken lengths, directions and extents access.js64-bit- CadCraft
-
Extents of the visible objects
The width, height and corners of the box round everything visible, said with the object counts.
w = maxX − minX; h = maxY − minY
Spoken lengths, directions and extents access.js64-bit- CadCraft
-
Objects within a radius
The objects within a given distance of a point, nearest first.
Spoken lengths, directions and extents access.js64-bit- CadCraft
-
Distance and side of each nearby object
For each object near the cursor: whether the cursor is on it, or how far away it is and on which side.
Spoken lengths, directions and extents access.js64-bit- CadCraft
-
Measure between two points
The length, angle, Δx and Δy said back after a command takes a point.
d = √(Δx² + Δy²); angle = atan2(Δy, Δx)
Spoken lengths, directions and extents access.js64-bit- CadCraft
-
Snap points near the cursor
The snap points within a radius of a point, nearest first, for stepping from one to the next with a key.
d = √((sx − px)² + (sy − py)²)
Spoken lengths, directions and extents access.js64-bit- CadCraft
-
Transform from point pairs
The move, turn, scale and mirror that carry one to three source points onto their destination points.
turn = atan2(d₂ − d₁) − atan2(s₂ − s₁); k = |d₁d₂| ÷ |s₁s₂|; M = T(d₁) · R(turn) · S(k) · T(−s₁)
Align and distribute align.js64-bit- CadCraft
-
Bounding boxes in the coordinate system in force
Each selected object's bounding box, measured along the axes of the user coordinate system when one is set.
with a UCS: box of R(−angle) · T(−origin) applied to the object
Align and distribute align.js64-bit- CadCraft
-
Edge or middle of a box
The left, center, right, top, middle or bottom coordinate of a bounding box.
center = (minX + maxX) ÷ 2; middle = (minY + maxY) ÷ 2
Align and distribute align.js64-bit- CadCraft
-
Moves that line objects up
For each object, the vector that brings its chosen edge or middle onto the reference.
d = ref − edge(box)
Align and distribute align.js64-bit- CadCraft
-
Moves that space objects evenly
For each object between the first and the last, the vector that makes the middles or the gaps equal.
centers: step = (mid_last − mid_first) ÷ (n − 1); gaps: gap = (span − Σ sizes) ÷ (n − 1)
Align and distribute align.js64-bit- CadCraft
-
Degrees, minutes, seconds to decimal degrees
The decimal angle for text such as 45°23'30", 45d23'30" or, inside a bearing, 45-23-30.
deg = d + m ÷ 60 + s ÷ 3600
Bearings and degrees-minutes-seconds angles.js64-bit- CadCraft
-
Bearing or DMS text to an angle
The angle in degrees, counter-clockwise from east, for a typed bearing such as N45°23'30"E or a plain DMS angle.
N…E: 90 − off; N…W: 90 + off; S…E: 270 + off; S…W: 270 − off
Bearings and degrees-minutes-seconds angles.js64-bit- CadCraft
-
Decimal degrees to degrees, minutes and seconds
The degrees, minutes and seconds text for an angle at the chosen precision.
n = round(deg × unit + 10⁻⁹); d = ⌊n ÷ unit⌋; m = ⌊rest ÷ (unit ÷ 60)⌋; s = (rest − m × unit ÷ 60) ÷ 10^secDec
Bearings and degrees-minutes-seconds angles.js64-bit- CadCraft
-
Angle to a surveyor's bearing
Bearing text such as N45°23'30"E for an angle in degrees.
a = deg mod 360; offset = |90 − a| (north half) or |270 − a| (south half)
Bearings and degrees-minutes-seconds angles.js64-bit- CadCraft
-
Angle in the drawing's angle format
An angle written as decimal degrees, degrees-minutes-seconds, grads, radians or a bearing.
grads = a × 10 ÷ 9; radians = a × π ÷ 180
Bearings and degrees-minutes-seconds angles.js64-bit- CadCraft
-
Bearing of a vector
The bearing text for a direction given by its x and y components.
angle = atan2(dy, dx) × 180 ÷ π
Bearings and degrees-minutes-seconds angles.js64-bit- CadCraft
-
Size in millimeters
The width and height of the copied area, on paper or at the drawing's real size.
paper: mm = pixels × ptPerPx × (25.4 ÷ 72); real: mm = pixels × mmPerPx
Size of a copied area areaclip.js64-bit- CadCraft
- BimCraft
- MarkupCraft
- DetailCraft
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.