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
-
Rounding a total
Cuts a sum to 12 significant digits so that binary noise such as 0.1 + 0.2 does not show.
tidy(n) = Number(n.toPrecision(12))
Quantity totals and schedules from IFC properties ifc-qto.js64-bit- BimCraft
-
Totals by group
Counts elements and sums the chosen number fields for each combination of group values and for the whole selection.
sum = Σ vᵢ over the elements with a number; counted = how many had one
Quantity totals and schedules from IFC properties ifc-qto.js64-bit- BimCraft
-
Spaces schedule totals
The total floor area and volume of the listed rooms.
Quantity totals and schedules from IFC properties ifc-qto.js64-bit- BimCraft
-
Is a property value the same in both versions
Decides whether a number or text property changed between two versions of a model.
same when |a − b| ≤ 1e-9 × max(1, |a|, |b|)
Quantity totals and schedules from IFC properties ifc-compare.js64-bit- BimCraft
-
Number shown in Properties
How a property or quantity value from the file is written out in the Properties panel.
shown = round(x × 10⁴) ÷ 10⁴
Quantity totals and schedules from IFC properties ifc-model.js64-bit- BimCraft
-
Placement of an item relative to its story
The location and X direction written to the file for a placed item.
(lx, ly) = W⁻¹ × (x ÷ unit, y ÷ unit, story z); direction = W⁻¹ rotation × (cos r, sin r)
Placing and pasting elements in an IFC model ifc-place.js64-bit- BimCraft
-
Position and rotation read back from a placement
The x, y and rotation of each placed item as listed in the equipment schedule and used by copy and paste.
x = W[12] × unit; y = W[13] × unit; rot = round(atan2(W[1], W[0]) in degrees × 1000) ÷ 1000
Placing and pasting elements in an IFC model ifc-place.js64-bit- BimCraft
-
An item's body in the file's unit
Writes a library item's mesh or box as IFC geometry in the file's length unit.
coordinate in file units = millimeters ÷ (millimeters per file unit)
Placing and pasting elements in an IFC model ifc-place.js64-bit- BimCraft
-
Plan outline as polylines
Turns the lines, arcs, circles, ellipses and bulged polylines of an item's plan into the straight segments written as its footprint.
arc: n = max(4, ⌈sweep ÷ 10°⌉) segments; bulge: θ = 4 atan(b), r = chord ÷ (2 sin(θ ÷ 2))
Placing and pasting elements in an IFC model ifc-place.js64-bit- BimCraft
-
Viewer point to model millimeters and back
Converts a point between the viewer's Y-up meters and the model's Z-up millimeters.
model = (x × 1000, −z × 1000, y × 1000) of C⁻¹ × v; viewer = C × (x ÷ 1000, z ÷ 1000, −y ÷ 1000)
Placing and pasting elements in an IFC model ifc-place.js64-bit- BimCraft
-
Move and turn of pasted elements
The matrix that carries copied elements to where they are pasted, with a turn about a point and a change of story.
M = T(about + d) × Rz(rot) × T(−about); dz = elevation of target story − elevation of source story
Placing and pasting elements in an IFC model ifc-elements.js64-bit- BimCraft
-
Placement written for a pasted element
The location, Z axis and X axis of the new placement, from its matrix.
location = round to 6 decimals; axis = column ÷ its length, rounded to 9 decimals
Placing and pasting elements in an IFC model ifc-elements.js64-bit- BimCraft
-
Wall faces in plan
The two long faces of each wall as plan segments in model millimeters, with a normal pointing away from the wall.
Wall faces and plan frames from element meshes ifc-place.js32-bit in part- BimCraft
-
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.js64-bit- BimCraft
-
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.js32-bit in part- BimCraft
-
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.js32-bit in part- BimCraft
-
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.js64-bit- BimCraft
-
Is this mesh a straight prism
Checks that the mesh is closed and consistently wound, and picks candidate directions for the prism's axis.
eps = tol × bounding-box diagonal, tol = 1e-6
Turning a face mesh back into an extrusion ifc-solids.js64-bit- BimCraft
-
Depth, frame and outline of the prism
The prism's depth, its origin and axes, and its outline and holes in the cap's own two axes.
h = v · n; depth = max h − min h; (u, v) = ((p − origin) · x, (p − origin) · y)
Turning a face mesh back into an extrusion ifc-solids.js64-bit- BimCraft
-
Removing collinear outline points
Drops outline corners that lie on the line between their neighbors.
drop b when |(b − a) × (c − b)| ≤ tol × max(1, |c − a|)
Turning a face mesh back into an extrusion ifc-solids.js64-bit- BimCraft
-
Volume of a closed mesh
The signed volume of a closed triangle mesh, used to check a conversion.
V = Σ A · (B × C) ÷ 6
Turning a face mesh back into an extrusion ifc-solids.js64-bit- BimCraft
-
Area of the prism's outline
The outline's area less its holes; times the depth it is the prism's volume.
area = |shoelace(outer)| − Σ |shoelace(hole)|
Turning a face mesh back into an extrusion ifc-solids.js64-bit- BimCraft
-
Writing the prism into the file
The IFC lines of the outline, its placement and the extrusion depth.
each number written as toFixed(6)
Turning a face mesh back into an extrusion ifc-solids.js64-bit- BimCraft
-
Degrees from degrees, minutes, seconds and millionths
Reads an IFC compound angle as decimal degrees.
deg = d + m ÷ 60 + (s + μ ÷ 10⁶) ÷ 3600
Where an IFC model point is on the earth ifc-geo.js64-bit- BimCraft
-
File point to map grid
Easting, northing and height in meters of a point of the file.
[E, N, H] = (matrix × p) × meters per map unit
Where an IFC model point is on the earth ifc-geo.js64-bit- BimCraft
-
Longitude and latitude from the site's reference point
An approximate WGS 84 position of a file point from its offset east and north of the site's point.
w = √(1 − e² sin² φ); N = a ÷ w; M = a (1 − e²) ÷ w³; lon = lon₀ + east ÷ ((N + h) cos φ); lat = lat₀ + north ÷ (M + h)
Where an IFC model point is on the earth ifc-geo.js64-bit- BimCraft
-
Degrees to degrees, minutes and seconds
Formats a latitude or longitude with its hemisphere letter.
d = ⌊|deg|⌋; m = ⌊(|deg| − d) × 60⌋; s = (|deg| − d − m ÷ 60) × 3600, shown with 2 decimals
Where an IFC model point is on the earth ifc-geo.js64-bit- BimCraft
-
Viewer point to the file's own coordinates
Takes a point picked in the viewer back to the file's Z-up coordinates in its own length unit.
y = C⁻¹ × (place⁻¹ × p); file = (y_x, −y_z, y_y) ÷ meters per file unit
Where an IFC model point is on the earth ifc-geo.js64-bit- BimCraft
-
Feature edges of one element
The edges of an element where its faces meet at more than the feature angle, plus its free edges.
edge drawn when n₁ · n₂ ≤ cos(angle), or when only one triangle uses it
Element outlines in the IFC view ifc-vis.js32-bit, display only- BimCraft
-
Edge segments of a batch
Collects every element's edges into one array of line segments with a run per element.
Element outlines in the IFC view ifc-vis.js32-bit, display only- BimCraft
-
Section of a run
The outside diameter, wall and bend radius of a pipe from the size table, or the width and height of a duct, in millimeters.
mm = inches × 25.4
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Run corners with the slope applied
The corners of a run with its fall along the horizontal length from the first point.
z = z₀ − slope × Σ horizontal leg length
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Bend radius of an elbow
The center-line radius an elbow is built with.
pipe: the table's radius; round duct: 1.5 × diameter; rectangular duct: its width for a turn in plan, its height for a turn up or down
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Elbow geometry at a corner
The two tangent points, center and angle of the elbow where a run turns.
θ = acos(d₁ · d₂); T = R × tan(θ ÷ 2); center = p₀ + n × R
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Where runs meet
Finds run ends that touch another run's end or lie on another run's line, to make an elbow, reducer or tee there.
end to end when |P − Q| ≤ max(tol_a, tol_b); tee when the foot of P on a leg is within the tolerance
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Elbow, reducer and tee allowances
How much of each leg an elbow, a reducer or a tee takes.
reducer length (duct) = max(150, max(|Δw|, |Δh|) ÷ 2 ÷ tan 15°); tee half length = max(25, 0.5 × branch + 0.25 × host)
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Straight pieces between fittings
The start and end of every straight piece along each leg, after trims, tees, valves and weld cuts.
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Saving a run's definition
The points, sizes, slope and flow kept in the run's property set.
point = round to 3 decimals of a millimeter
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Length and surface written on each piece
The length of a straight pipe or duct piece and a duct's outside surface, written as IFC quantities.
L = |b − a|; perimeter = π w (round), π h + 2 (w − h) (oval), 2 (w + h) (rectangle); surface = perimeter × L
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Elbow written as a revolved section
The axis and angle of the solid of revolution that an elbow is written as.
axis at R to the side of the section; angle = θ
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Flat-oval outline
The outline of a flat-oval duct with semicircular ends.
r = H ÷ 2; c = W ÷ 2 − r; points at c + r cos a, r sin a
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Connecting ports that touch
Joins a port to a port of another part that lies at the same place.
connected when |p − q| < 0.6 mm
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Position along a run
How far along a run a plan point lies, and how far off the line.
t = clamp((p − a) · d, 0, L); s = Σ earlier legs + t
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Length of a run
The length of a run's center line through its corners, with the slope applied.
L = Σ |Vᵢ − Vᵢ₋₁|
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Pipe size for a flow and a velocity limit
The smallest pipe of a material and class whose velocity stays at or under the limit.
V = Q ÷ (π D² ÷ 4); first size with V ≤ V_max
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Duct size for a flow
A duct sized by equal friction, returned in millimeters.
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Drain sizes by fixture units
The smallest drain size that carries the fixture units reaching each sanitary run, never smaller than what flows into it.
grow when needed nominal > drawn nominal + 1e-9
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Pipe and duct schedules
Total length and piece count per pipe size, and length and surface per duct size.
length = Σ stored piece lengths; surface = Σ perimeter × length
Pipe and duct runs: layout, lengths and sizing mep-model.js64-bit- BimCraft
-
Friction rate of a round duct at the velocity limit
The pressure drop per meter used to propose a duct size when the calculation ran by velocity.
D = √(4 Q ÷ (π v)); rate = 0.02 × (1.204 ÷ D) × v² ÷ 2
Pipe and duct runs: layout, lengths and sizing mep-calc.js64-bit- BimCraft
-
Proposed duct sizes
The width and height proposed for each duct run that is too small or too fast.
size for the largest flow in the run, rounded to 1 mm
Pipe and duct runs: layout, lengths and sizing mep-calc.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.