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
-
Knot span
Which knot interval a B-spline parameter falls in.
STEP curves and surfaces: points from parameters step/geom.jsExact- BimCraft
- ModelCraft
- PartCraft
-
B-spline basis functions
The p + 1 basis functions that are not zero at a parameter.
N_{i,0} = 1; N_{i,j} built from (t − u) ÷ (u_b − u_a) terms in the Cox–de Boor triangular table
STEP curves and surfaces: points from parameters step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
B-spline curve point
The point on a B-spline or rational B-spline curve at a parameter.
C(t) = Σ Nᵢ wᵢ Pᵢ ÷ Σ Nᵢ wᵢ
STEP curves and surfaces: points from parameters step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Is a B-spline curve closed
Decides whether a B-spline curve's two ends meet, so it can be treated as periodic.
|C(t₀) − C(t₁)| < 1e-9 × max(1, max |Pᵢ|)
STEP curves and surfaces: points from parameters step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
B-spline surface point
The point on a B-spline or rational B-spline surface at (u, v).
S(u, v) = Σ Σ Nᵢ(u) Nⱼ(v) wᵢⱼ Pᵢⱼ ÷ Σ Σ Nᵢ(u) Nⱼ(v) wᵢⱼ
STEP curves and surfaces: points from parameters step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Seams and poles of a B-spline surface
Decides which direction of a B-spline surface closes on itself and which boundary rows collapse to a point.
two points are the same when |a − b| < 1e-7 × max(1, |a|)
STEP curves and surfaces: points from parameters step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Cylinder
The point at (angle, height) on a cylinder, and the angle and height of a point.
S(u, v) = o + r cos u · x + r sin u · y + v · z
STEP curves and surfaces: points from parameters step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Cone
The point at (angle, distance along the axis) on a cone, and the inverse.
r(v) = R + v tan α; v = ((ρ − R) tan α + l_z) ÷ (tan² α + 1)
STEP curves and surfaces: points from parameters step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Sphere
The point at (longitude, latitude) on a sphere, and the inverse.
S(u, v) = o + r cos v cos u · x + r cos v sin u · y + r sin v · z
STEP curves and surfaces: points from parameters step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Torus
The point at two angles on a torus, and the inverse.
c = R + r cos v; S(u, v) = o + c cos u · x + c sin u · y + r sin v · z
STEP curves and surfaces: points from parameters step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Surface of revolution
The point of a profile curve turned about an axis by an angle, and the inverse.
S(u, v) = o + h z + rr cos u + (z × rr) sin u, h = (C(v) − o)·z, rr = (C(v) − o) − h z
STEP curves and surfaces: points from parameters step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Angle of a point on an ellipse
The ellipse parameter of the point on the ellipse nearest a given point.
f(t) = (E(t) − q)·E′(t) = 0, solved by t ← t − f ÷ f′
STEP curves and surfaces: parameters from points step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Parameter of a point on a B-spline curve
The curve parameter nearest a given point.
STEP curves and surfaces: parameters from points step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Parameters of a point on a B-spline surface
The (u, v) of the surface point nearest a given point.
[S_u·S_u S_u·S_v; S_u·S_v S_v·S_v] d = −[r·S_u; r·S_v], r = S(u, v) − q
STEP curves and surfaces: parameters from points step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Surface of linear extrusion
The point of a curve swept along a vector, and the (u, v) of a point.
S(u, v) = C(u) + v · vec; v = (q − C(u))·d ÷ |vec|, u = project(q − v · vec)
STEP curves and surfaces: parameters from points step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Offset surface
The point of a surface moved a distance along its normal.
S_off(u, v) = S(u, v) + d · n, n = (ΔS_u × ΔS_v) ÷ |…|
STEP curves and surfaces: parameters from points step/geom.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Length and angle units
The file's length unit in millimeters and its plane-angle unit in radians.
mm = prefix × 1000 for a meter; a conversion-based unit = its value × its base unit
STEP import: units, points and assembly placement step/read.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Point coordinates
A CARTESIAN_POINT in millimeters.
(x, y, z) × unit in mm
STEP import: units, points and assembly placement step/read.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Radii and cone angles
The radius of a cylinder, cone, sphere or torus in millimeters and a cone's half angle in radians.
r × unit in mm; α × angle unit, accepted when 0 < |α| < π ÷ 2
STEP import: units, points and assembly placement step/read.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Knot vectors
The full knot vector of a B-spline from the file's knots and multiplicities, or the one a uniform, quasi-uniform or Bézier form implies.
STEP import: units, points and assembly placement step/read.jsExact- BimCraft
- ModelCraft
- PartCraft
-
Model size and chord tolerance
The size of the model and the distance a triangle may stray from a curved face.
size = diagonal of the box around every point; tol = max(4e-4 × size, 1e-4 mm)
STEP import: units, points and assembly placement step/read.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Closing a loop of edges
Drops the last point of an edge loop when it repeats the first.
|first − last| ≤ 0.01 × tol
STEP import: units, points and assembly placement step/read.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Placement matrices
A placement as a 4 × 4 matrix, the product of two and the inverse of one.
M⁻¹ = [Rᵀ, −Rᵀ t]
STEP import: units, points and assembly placement step/read.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
A component placed in its assembly
The transform that carries a component's coordinates into the assembly that uses it.
T = M(A₂) × M(A₁)⁻¹
STEP import: units, points and assembly placement step/read.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Placed vertex positions
Every vertex of a solid moved to its place and stored for the app.
p′ = R p + t
STEP import: units, points and assembly placement step/read.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Faceted faces
Triangles for a flat face given as loops of points.
n = Σ ((yᵢ − yⱼ)(zᵢ + zⱼ), (zᵢ − zⱼ)(xᵢ + xⱼ), (xᵢ − xⱼ)(yᵢ + yⱼ))
STEP import: units, points and assembly placement step/read.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Points along an edge
The points of an edge from its start vertex to its end vertex along its curve.
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
How finely a curve is divided
The parameters at which an edge curve is sampled.
circle step = min(π ÷ 24, 2 acos(1 − tol ÷ r)); else halve while the middle is more than tol from the chord or the turn exceeds π ÷ 24
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Turn and crossing tests
Whether three points turn left, right or run straight, and whether two segments cross.
x = (a − o) × (b − o); left when x > 1e-9 × |ab| × |bc|, right when x < −1e-9 × |ab| × |bc|
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Holes joined to the outer ring
One ring made from a face's outer loop and its holes by bridges, ready for ear clipping.
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Ear clipping
Triangles of a simple polygon in the plane.
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
A loop in the surface's (u, v)
The parameters of each boundary point, with periodic directions unwrapped and poles split.
uᵢ ← uᵢ + round((uⱼ − uᵢ) ÷ period) × period
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Scaled layout and first triangles
The (u, v) points scaled to lengths, the loops given their turning sense, and the first triangulation.
M = (u × s_u, v × s_v); loop sense = sign of Σ (xᵢ yⱼ − xⱼ yᵢ)
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Apex of a cone
The parameter at which a cone's radius reaches zero, for a face that closes at the apex.
R = |S(0, 0) − S(π, 0)| ÷ 2; k = |S(0, 1) − S(π, 1)| ÷ 2 − R; v_apex = −R ÷ k
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Interior grid spacing
How far apart interior points are placed on each kind of surface.
angle step = min(π ÷ 24, 2 acos(1 − tol ÷ r))
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Interior points inserted
Grid points added inside a face and joined into the triangulation.
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
In-circle test
Whether a fourth point lies inside the circle through three others.
det of rows (a − d, |a − d|²), (b − d, |b − d|²), (c − d, |c − d|²)
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Edge flips
Inside edges flipped toward a Delaunay triangulation in the scaled (u, v).
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Refinement to the chord tolerance
Inside edges split where the surface is farther than the tolerance from the triangles.
split when |S(mid uv) − (P_a + P_b) ÷ 2| > tol, or when a triangle's center is more than tol from its plane
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Facing and self-check
The 3D position of every point, the triangles turned to face outward, and a check of how far the mesh is from the surface.
worst = max |S(center uv) − center of triangle| over up to 64 triangles; noted when worst > 25 × tol
STEP import: triangles for curved faces step/tess.js64-bit- BimCraft
- ModelCraft
- PartCraft
-
Distance between two points
The length a headset measurement reports.
d = √(Δx² + Δy² + Δz²)
Headset review: measuring, section cuts and issue cameras xr/xr-core.js64-bit- BimCraft
- ModelCraft
-
Snap to a corner
The corner of the hit triangle nearest the hit, when it is within the snap radius.
Headset review: measuring, section cuts and issue cameras xr/xr-core.js64-bit- BimCraft
- ModelCraft
-
Model to headset transform
The matrix that places the model in the headset's space.
M = T(anchor) · R_y(yaw) · S(scale) · T(−at)
Headset review: measuring, section cuts and issue cameras xr/xr-core.js64-bit- BimCraft
- ModelCraft
-
Inverse of a rig or pose
The inverse of a rigid motion with one uniform scale.
M⁻¹ = [Rᵀ ÷ s², −(Rᵀ ÷ s²) t], s² = squared length of the first column
Headset review: measuring, section cuts and issue cameras xr/xr-core.js64-bit- BimCraft
- ModelCraft
-
Section plane
The plane of a section cut through what was pointed at.
n = normal toward the eye; p = hit − n × depth; d = n·p
Headset review: measuring, section cuts and issue cameras xr/xr-core.js64-bit- BimCraft
- ModelCraft
-
Issue camera
The viewpoint, direction and up vector saved with an issue, in the app's coordinates.
to app = M_up⁻¹ · M_rig⁻¹; eye = to app × head position
Headset review: measuring, section cuts and issue cameras xr/xr-core.js64-bit- BimCraft
- ModelCraft
-
The point being pointed at
The model point, surface normal and triangle under a controller's ray.
Headset review: measuring, section cuts and issue cameras xr/xr-session.js32-bit in part- BimCraft
- ModelCraft
-
A measurement in the headset
The length shown on the label between two picked points.
d = |q − p|, shown through the app's length format
Headset review: measuring, section cuts and issue cameras xr/xr-session.js32-bit in part- BimCraft
- ModelCraft
-
Where an issue is placed
The point and camera handed to the app with a new issue.
Headset review: measuring, section cuts and issue cameras xr/xr-session.js32-bit in part- BimCraft
- ModelCraft
-
Two-point fit
The turn and move that carry two model points onto two site points, with the remaining error.
yaw = atan2(Δw) − atan2(Δm); t = mid(w) − R mid(m); residual = max(|R m₁ + t − w₁|, |R m₂ + t − w₂|); scale off = |Δw| ÷ |Δm| − 1
AR on site: lining the model up with the building xr/xr-core.js64-bit- BimCraft
- ModelCraft
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.