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
-
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
-
Cylinder and cone
A point on a cylindrical or conical surface from (u, v), and (u, v) from a point.
p = o + (r + v tan α)(x cos u + y sin u) + z v; u = atan2(d · y, d · x), v = d · z
IFC faces on curved surfaces ifc/geo-nurbs.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
Swept curve by length
The generating curve of an extruded or revolved surface as a polyline with a length parameter.
s_i = s_{i−1} + |p_i − p_{i−1}|; point at s by linear interpolation
IFC faces on curved surfaces ifc/geo-nurbs.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
B-spline basis functions
The non-zero basis functions of a B-spline at a parameter.
Cox-de Boor: N_r = saved + right × N_r ÷ (right + left)
IFC faces on curved surfaces ifc/geo-nurbs.js64-bit- BimCraft
- TakeoffCraft
- CivilCraft
- DetailCraft
-
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
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.