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
-
Point on a B-spline surface
The point of a B-spline surface, rational or not, at (u, v).
p = Σ N_i(u) N_j(v) (w P)_ij ÷ Σ N_i(u) N_j(v) w_ij
IFC faces on curved surfaces ifc/geo-nurbs.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Parameters of a point on a B-spline surface
Finds (u, v) of a 3D point on a B-spline surface.
start at the nearest of 25 × 25 samples; Newton: solve (Sᵤ·Sᵤ, Sᵤ·Sᵥ; Sᵤ·Sᵥ, Sᵥ·Sᵥ) Δ = (r·Sᵤ, r·Sᵥ)
IFC faces on curved surfaces ifc/geo-nurbs.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Boundary points put back on the surface
Moves a boundary point onto the surface when the file's edge curve leaves it.
tolerance = max(10⁻⁹, 0.001 × diagonal of the loops' box)
IFC faces on curved surfaces ifc/geo-nurbs.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Spacing of interior points
The spacing of the points added inside a face, from how fast the surface normal turns.
h = clamp(0.2 ÷ turn, extent ÷ 96, extent ÷ 4), turn = largest change of the normal per unit over a 9 × 9 grid
IFC faces on curved surfaces ifc/geo-nurbs.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Scale of the parameter plane
Scale factors that make distances in (u, v) roughly equal to distances on the surface.
s_u = mean |S(u + e, v) − S(u, v)| ÷ e, e = 10⁻⁴ (1 + |u|)
IFC faces on curved surfaces ifc/geo-nurbs.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Circumcircle of a triangle
The center and squared radius of a triangle's circumcircle, for the Delaunay test.
D = 2 (a_x (b_y − c_y) + b_x (c_y − a_y) + c_x (a_y − b_y)); center = Σ |p|² × (difference) ÷ D
IFC faces on curved surfaces ifc/geo-nurbs.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Delaunay triangulation
Triangulates the face's points in the scaled parameter plane.
a point is inside a circumcircle when (x − c_x)² + (y − c_y)² < r² (1 + 10⁻¹²)
IFC faces on curved surfaces ifc/geo-nurbs.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Orientation and crossing tests
Whether three points turn left or right, and whether two segments cross, for recovering the boundary edges.
orient = (b_x − a_x)(c_y − a_y) − (b_y − a_y)(c_x − a_x)
IFC faces on curved surfaces ifc/geo-nurbs.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
SI value of the file's units
The factor that turns the file's length, area, volume and mass values into meters, square meters, cubic meters and kilograms.
SI unit: factor = prefix; conversion-based unit: the file's factor; gram: × 0.001
IFC 4.3 infrastructure quantities and files ifc/ifc43.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Quantities of an element
The lengths, areas, volumes and weights an element states in its quantity sets, in SI units.
SI value = stated value × unit factor
IFC 4.3 infrastructure quantities and files ifc/ifc43.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Length of an alignment
The length of an alignment curve from the lengths of its segments.
L = Σ |SegmentLength|
IFC 4.3 infrastructure quantities and files ifc/ifc43.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Rounding of totals
Rounds a total length, area or volume before it is listed or written to a quantities file.
ROUND(v) = v to 12 significant digits
IFC 4.3 infrastructure quantities and files ifc/ifc43.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Totals per class
The count and the total length, area and volume of each class and predefined type.
total = Σ of the first stated quantity of that kind per element
IFC 4.3 infrastructure quantities and files ifc/ifc43.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Numbers in a written file
Formats a coordinate, length or quantity for a new IFC 4.3 file.
R(v, d) = v with d decimals, trailing zeros removed; d = 9, or 12 for directions
IFC 4.3 infrastructure quantities and files ifc/ifc43.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Alignment segments written
The straight segments of a written alignment: each one's start, direction and length.
length = √(Δx² + Δy²); direction = (Δx, Δy) ÷ length
IFC 4.3 infrastructure quantities and files ifc/ifc43.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Area of a written profile
The cross-section area of an element in a written file, from its rectangle, circle or polygon.
circle: π r²; polygon: |Σ (xₐ y_b − x_b yₐ)| ÷ 2; rectangle: w × d
IFC 4.3 infrastructure quantities and files ifc/ifc43.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Quantities written for an element
The length, width, height, footprint area and volume written to an element's quantity set.
Length = longer side; Width = shorter side; GrossVolume = area × height
IFC 4.3 infrastructure quantities and files ifc/ifc43.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Fixture units a size carries
The fixture units a drain of a nominal size carries at a slope, as a branch or as a building drain.
column = last listed slope ≤ slope + 10⁻⁹; capacity = table[size][column]
Sanitary drain sizing by fixture units mep/drainage.jsExact- BimCraft
-
Smallest size that carries the load
The first size, smallest first, that carries the fixture units and is not below the least size allowed.
Sanitary drain sizing by fixture units mep/drainage.jsExact- BimCraft
-
Distance from a point to a run
The shortest distance from a run's end or a fixture's connector to another run's center line.
t = clamp(((p − a) · d) ÷ |d|², 0, 1); distance = |p − a − d t|
Sanitary drain sizing by fixture units mep/drainage.js64-bit- BimCraft
-
Fixture units carried by each run
Which run each run and fixture drains into, and the total fixture units and least size of every run.
total = own fixtures + Σ totals of the runs flowing in
Sanitary drain sizing by fixture units mep/drainage.jsExact- BimCraft
-
Typed sizes of a piece of equipment
Checks the values a person typed and gives the sizes the equipment is built from.
length = round(v, 3), 10 ≤ v ≤ 20000
MEP equipment, ports and refrigerant line sets mep/equipment.js64-bit- BimCraft
-
Equipment solids as a mesh
Turns the boxes and cylinders of a piece of equipment into one triangle mesh.
cylinder ring = o + u r cos a + w r sin a, a = 2π i ÷ 16; each coordinate rounded to 3 decimals
MEP equipment, ports and refrigerant line sets mep/equipment.js64-bit- BimCraft
-
Port positions of placed equipment
Where each port of a placed piece sits on its level and the way it faces.
at = (x, y, z) + R(rot) · local; R turns about Z by rot × π ÷ 180
MEP equipment, ports and refrigerant line sets mep/equipment.js64-bit- BimCraft
-
Port sizes written to the model
The width and height stored on each port.
stored = round(size in the file's unit)
MEP equipment, ports and refrigerant line sets mep/equipment.js64-bit- BimCraft
-
Placement stored with the equipment
The position and turn kept in the equipment's property set, from which it is read back and rebuilt.
X, Y, Z = round(value, 3); Rotation = round(degrees, 6)
MEP equipment, ports and refrigerant line sets mep/equipment.js64-bit- BimCraft
-
Line set sizes for a capacity
The liquid and gas tube sizes for the cooling capacity a refrigerant line carries.
row = first with capacity ≤ upTo + 10⁻⁹; beyond the table: the last row
MEP equipment, ports and refrigerant line sets mep/hvac.jsExact- BimCraft
-
A line set table someone typed
Checks a custom table of capacities and tube sizes before it is used and saved.
upTo = round(upTo × 100) ÷ 100, 0 < upTo ≤ 2000, rising
MEP equipment, ports and refrigerant line sets mep/hvac.js64-bit- BimCraft
-
Refrigerant tube diameter
The outside diameter in millimeters of a refrigerant tube from its inch size.
od = table inches × 25.4
MEP equipment, ports and refrigerant line sets mep/hvac.js64-bit- BimCraft
-
Route of a line between two ports
An orthogonal path from one port to another: straight out of each, up to a common height, then across.
points rounded to 3 decimals; common height = max of the two leads + lift + 0, 300 or 600
MEP equipment, ports and refrigerant line sets mep/hvac.js64-bit- BimCraft
-
Cleaning a route
Drops repeated points and corners that go straight through.
merge if |p − q| ≤ 0.5; straight if |d₁ · d₂ − |d₁||d₂|| < 10⁻⁶ |d₁||d₂|
MEP equipment, ports and refrigerant line sets mep/hvac.js64-bit- BimCraft
-
Soundness of a route
Rejects a route that doubles back, has an inner leg shorter than 100 mm, or has a leg that is not along one axis.
MEP equipment, ports and refrigerant line sets mep/hvac.js64-bit- BimCraft
-
Position and direction of a port read from the model
A port's origin and the way it faces, in its level's axes in millimeters.
at = round(M₁₂…₁₄ × 1000) ÷ 1000; out = round(z ÷ |z| × 10⁹) ÷ 10⁹
MEP equipment, ports and refrigerant line sets mep/ports.js64-bit- BimCraft
-
Mean and variance from batches
The mean picture and the variance of that mean from two or more independent batch pictures.
mean = Σ b ÷ k; var(mean) = Σ (b − mean)² ÷ (k − 1) ÷ k
Statistical comparison of rendered pictures compute/parity.js64-bit- BimCraft
- ModelCraft
-
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.js64-bit- BimCraft
- ModelCraft
-
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.js64-bit- BimCraft
- ModelCraft
-
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.js64-bit- BimCraft
- ModelCraft
-
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.js64-bit- BimCraft
- ModelCraft
-
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.js64-bit- BimCraft
- ModelCraft
-
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.js64-bit- BimCraft
- ModelCraft
-
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.js64-bit- BimCraft
- ModelCraft
-
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.js64-bit- BimCraft
- ModelCraft
-
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.js64-bit- BimCraft
- ModelCraft
-
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.js64-bit- BimCraft
- ModelCraft
-
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.js64-bit- BimCraft
- ModelCraft
- CivilCraft
-
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.js64-bit- BimCraft
- ModelCraft
- CivilCraft
-
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.js64-bit- BimCraft
- ModelCraft
- CivilCraft
-
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.js64-bit- BimCraft
- ModelCraft
- CivilCraft
-
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.js64-bit- BimCraft
- ModelCraft
- CivilCraft
-
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.js64-bit- BimCraft
- ModelCraft
- CivilCraft
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.