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.

  • 6,917 calculations in 1,248 source files
  • 143 exact
  • 6,286 in 64-bit
  • 335 with a 32-bit step
  • Last reviewed

Calculations

  • Knot span

    Which knot interval a B-spline parameter falls in.

    STEP curves and surfaces: points from parameters step/geom.js
    • BimCraft
    • ModelCraft
    • PartCraft
    Exact
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Point coordinates

    A CARTESIAN_POINT in millimeters.

    (x, y, z) × unit in mm

    STEP import: units, points and assembly placement step/read.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    Exact
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Ear clipping

    Triangles of a simple polygon in the plane.

    STEP import: triangles for curved faces step/tess.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Interior points inserted

    Grid points added inside a face and joined into the triangulation.

    STEP import: triangles for curved faces step/tess.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Edge flips

    Inside edges flipped toward a Delaunay triangulation in the scaled (u, v).

    STEP import: triangles for curved faces step/tess.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    64-bit
  • 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.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • 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.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • 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.js
    • BimCraft
    • ModelCraft
    32-bit in part
  • 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.js
    • BimCraft
    • ModelCraft
    64-bit

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.