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 inside the room
Whether a point lies inside the room outline.
Sprinkler layout and hydraulic calculation addons/sprinkler/lib/layout.js64-bit- BimCraft
-
Head in a partly filled cell
Moves the head of a grid cell the room only partly fills to the middle of the part inside.
position = mean of the cell's 6 × 6 sample points that lie inside
Sprinkler layout and hydraulic calculation addons/sprinkler/lib/layout.js64-bit- BimCraft
-
Uncovered share of the room
The share of the room farther than 0.75 × the allowed spacing from every head.
uncovered = samples with no head within 0.75 × maxS ÷ samples inside the room
Sprinkler layout and hydraulic calculation addons/sprinkler/lib/layout.js64-bit- BimCraft
-
Pipe length and rise
The length in meters and the rise of each pipe of the network from its two end points.
length = √(Δx² + Δy² + Δz²) ÷ 1000; dz = Δz ÷ 1000
Sprinkler layout and hydraulic calculation addons/sprinkler/lib/layout.js64-bit- BimCraft
-
Sprinkler properties in the model
The K-factor, coverage, design density and hazard class written on each placed head.
CoverageM2 = round(coverage × 100) ÷ 100
Sprinkler layout and hydraulic calculation addons/sprinkler/lib/place.js64-bit- BimCraft
-
SI value of a file unit
Meters per file length unit and radians per file angle unit.
SI unit: 10^prefix; conversion-based unit: factor × factor of its base unit; by name: degree π ÷ 180, inch 0.0254, foot 0.3048
IFC units and placements ifc/geo-ctx.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Axis placement as a matrix
The matrix of an IfcAxis2Placement3D, 2D or IfcAxis1Placement.
columns = (x, z × x, z, origin), x = reference direction projected square to z
IFC units and placements ifc/geo-ctx.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
First projection axis
The X axis of a placement: the reference direction projected into the plane normal to Z.
x = normalize(v − z (v · z))
IFC units and placements ifc/geo-ctx.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Cartesian transformation operator
The matrix of an IfcCartesianTransformationOperator, uniform or not, in 2D or 3D.
columns = (x s₁, y s₂, z s₃, origin)
IFC units and placements ifc/geo-ctx.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
World matrix of a placement
The position of an element in the model from its chain of relative placements.
world = parent world × local
IFC units and placements ifc/geo-ctx.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Grid placement
The point where two grid axes meet, with their offsets, as a placement.
t = ((pB − pA) × dB) ÷ (dA × dB); point = pA + dA t
IFC units and placements ifc/geo-ctx.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Map conversion
The matrix that takes model coordinates to map coordinates, with its rotation and scale.
map = (E, N, H) + R(θ) · S · model; θ = atan2(ordinate, abscissa)
IFC units and placements ifc/geo-ctx.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Matrix product
The product of two 4 × 4 matrices.
IFC units and placements ifc/geo-math.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Point through a matrix
Transforms a point by a matrix.
p' = M · (x, y, z, 1)
IFC units and placements ifc/geo-math.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Matrix inverse
The inverse of a 4 × 4 matrix, or null when it has none.
M⁻¹ = adjugate ÷ determinant
IFC units and placements ifc/geo-math.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Rotation about an axis
The matrix that turns by an angle about an axis through the origin.
R = c I + s [a]× + (1 − c) a aᵀ
IFC units and placements ifc/geo-math.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Polygon normal
The normal of a 3D polygon, with a length of twice its area.
n = Σ ((yₐ − y_b)(zₐ + z_b), (zₐ − z_b)(xₐ + x_b), (xₐ − x_b)(yₐ + y_b))
IFC units and placements ifc/geo-math.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Signed area of a 2D polygon
The area of a profile outline, positive when counter-clockwise; used to orient outlines and holes.
A = Σ (xₐ y_b − x_b yₐ) ÷ 2
IFC units and placements ifc/geo-math.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Positions and normals handed to the app
Packs the mesh into the vertex and index arrays the apps read.
vertices = Float32Array of (x, y, z, nx, ny, nz) per vertex
Triangle mesh built from IFC geometry ifc/geo-mesh.js32-bit in part- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Planar face
Adds one planar face with holes as triangles, all with the face's normal.
Triangle mesh built from IFC geometry ifc/geo-mesh.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Mesh moved by a matrix
Adds another mesh, transformed, with its normals turned to match.
p' = M p; n' = normalize((M⁻¹)ᵀ n); a mirror swaps the winding
Triangle mesh built from IFC geometry ifc/geo-mesh.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Signed volume
The volume enclosed by the mesh, positive when the triangles face outward.
V = Σ a · (b × c) ÷ 6
Triangle mesh built from IFC geometry ifc/geo-mesh.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Shared vertices
Merges vertices that fall in the same grid cell, for boolean operations.
key = (round(x ÷ eps), round(y ÷ eps), round(z ÷ eps))
Triangle mesh built from IFC geometry ifc/geo-mesh.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Segments of an arc
How many chords replace an arc of a given sweep.
n = max(2, ceil(|sweep| ÷ 2π × 36))
IFC curves and profiles as point lists ifc/geo-curve.jsExact- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Arc through three points
The circular arc of an indexed poly-curve from its start, middle and end points.
center = a + ((|ab|² (ac × n)) + (|ac|² (n × ab))) ÷ (2 |n|²), n = ab × ac
IFC curves and profiles as point lists ifc/geo-curve.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Circle and ellipse points
Points on a circle or ellipse between two parameters.
p = M · (r₁ cos θ, r₂ sin θ, 0), θ = a₀ + sweep × i ÷ n
IFC curves and profiles as point lists ifc/geo-curve.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Trimmed curve
The part of a line, circle, ellipse or other curve between two trims given as parameters or points.
conic: angle = parameter × angle unit, or atan2 of the trim point in the conic's frame
IFC curves and profiles as point lists ifc/geo-curve.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
B-spline curve points
Points on a B-spline curve, rational or not, at 12 evenly spaced parameters per knot span.
de Boor: d_j = (1 − a) d_{j−1} + a d_j, a = (u − k_i) ÷ (k_{i+p+1−r} − k_i); point = (x, y, z) ÷ w
IFC curves and profiles as point lists ifc/geo-curve.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Offset of a polyline
A 2D polyline moved to its left by a distance, with mitered corners.
p' = p + n × d ÷ max(0.2, n · n₁), n = normalized sum of the two edge normals
IFC curves and profiles as point lists ifc/geo-curve.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Circle and ellipse profiles
The outline of a circular, hollow circular or elliptical profile.
(r₁ cos a, r₂ sin a), a = 2π i ÷ 36
IFC curves and profiles as point lists ifc/geo-profile.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Fillets and edge radii
Replaces corners of a profile outline with arcs of given radii tangent to both edges.
d = r ÷ tan(half); center = corner + bisector × r ÷ sin(half), half = half the corner angle
IFC curves and profiles as point lists ifc/geo-profile.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
I-shape outline
The outline of a symmetric or asymmetric I-section with flange slopes, fillets and edge radii.
inner flange face = thickness + tan(slope) × distance from the quarter point of the outstand
IFC curves and profiles as point lists ifc/geo-profile.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Closing an outline
Drops repeated points of a profile curve and its closing point.
IFC curves and profiles as point lists ifc/geo-profile.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Straight extrusion
The solid of a profile swept along a direction by a depth, with end caps and sides.
top = bottom + direction × depth
IFC swept solids, primitives and faceted shapes ifc/geo-solid.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Side face of a sweep
Adds a four-sided face as one flat face or as two triangles.
IFC swept solids, primitives and faceted shapes ifc/geo-solid.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Revolved solid
The solid of a profile turned about an axis by an angle.
p_k = o + R(axis, angle × k ÷ steps) · (p − o), steps = 36 per full turn
IFC swept solids, primitives and faceted shapes ifc/geo-solid.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Frames along a path
The tangent, normal and binormal at each point of a 3D polyline, and the miter stretch at each bend.
tangent = normalize(t_in + t_out); miter = 1 ÷ max(0.25, t_in · tangent)
IFC swept solids, primitives and faceted shapes ifc/geo-solid.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Normal carried round a bend
Turns the section's normal by the rotation that takes the previous tangent to the next.
angle = atan2(|a × b|, a · b); v' = R(a × b, angle) v, made square to b
IFC swept solids, primitives and faceted shapes ifc/geo-solid.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Swept disk
A round bar or tube along a path, such as rebar, with an optional inner radius and bend radius.
section = 36-sided polygon of the radius; swept on the path's frames
IFC swept solids, primitives and faceted shapes ifc/geo-solid.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Bends of a swept path
Rounds the corners of a 3D polyline with arcs of a given radius.
d = min(r ÷ tan(half), 0.999 × each leg); center = corner + bisector × r' ÷ sin(half)
IFC swept solids, primitives and faceted shapes ifc/geo-solid.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Sphere
The mesh of an IfcSphere.
(r sin θ cos φ, r sin θ sin φ, r cos θ), θ = π i ÷ 12, φ = 2π j ÷ 24
IFC swept solids, primitives and faceted shapes ifc/geo-solid.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Outer bound of a face
Picks the largest loop of a face as its outer bound when the file marks none.
size = |Σ ((yₐ − y_b)(zₐ + z_b), (zₐ − z_b)(xₐ + x_b), (xₐ − x_b)(yₐ + y_b))| (twice the area)
IFC swept solids, primitives and faceted shapes ifc/geo-brep.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Repeated points of a loop
Drops consecutive points of a face loop that coincide, and a closing point equal to the first.
IFC swept solids, primitives and faceted shapes ifc/geo-brep.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Point on a clothoid
The point at a length along a clothoid from its origin.
x = ∫₀ˢ cos(k u²) du, y = ∫₀ˢ sin(k u²) du, k = sign(A) ÷ (2A²); Simpson's rule
IFC alignment curves and stations ifc/geo-align.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Points of a curve segment
Samples one alignment segment from its parent curve and places it at the segment's start.
n = max(2, min(400, ceil(|length| ÷ 2))); p_i = T · f(start + length × i ÷ n)
IFC alignment curves and stations ifc/geo-align.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Distance along the alignment
The horizontal distance of each sampled point from the start.
d_i = d_{i−1} + √(Δx² + Δy²)
IFC alignment curves and stations ifc/geo-align.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Height from the vertical profile
The height of each horizontal point from the alignment's vertical profile.
z = z_lo + (z_hi − z_lo) × (d − d_lo) ÷ (d_hi − d_lo)
IFC alignment curves and stations ifc/geo-align.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Point at a station
The position and direction on a curve at a distance along it.
p = p_{i−1} + (p_i − p_{i−1}) × (d − d_{i−1}) ÷ (d_i − d_{i−1})
IFC alignment curves and stations ifc/geo-align.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Placement along an alignment
The matrix of an element placed at a station with lateral, vertical and longitudinal offsets.
origin = p + left × lateral + (0, 0, vertical) + heading × longitudinal
IFC alignment curves and stations ifc/geo-align.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Solid between cross sections
The solid of an IfcSectionedSolidHorizontal: cross sections placed across the alignment at their stations and joined.
ring point = o + x × ((1 − f) a_x + f b_x) + y × ((1 − f) a_y + f b_y), f = (d − d₀) ÷ (d₁ − d₀)
IFC alignment curves and stations ifc/geo-align.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- 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.