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

  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Matrix product

    The product of two 4 × 4 matrices.

    IFC units and placements ifc/geo-math.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Point through a matrix

    Transforms a point by a matrix.

    p' = M · (x, y, z, 1)

    IFC units and placements ifc/geo-math.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Position and direction of a port

    Where a port is, in millimeters, and the way it faces.

    p = M · (0, 0, 0) × mm; z = normalize(M · (0, 0, 1) direction)

    Piping in an IFC file as PCF components ifc/pipes.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Ends and bore from the extruded body

    The two ends of a pipe segment and its bore from its extruded solid.

    a = T · 0; b = T · (direction × depth); bore = 2 × radius × mm

    Piping in an IFC file as PCF components ifc/pipes.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Turn angle of a fitting

    The angle a two-port fitting turns the pipe through.

    turn = 180 − acos(p · q) × 180 ÷ π, rounded to 2 decimals

    Piping in an IFC file as PCF components ifc/pipes.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Center point of a bend

    The corner where the axes of a bend's two ports meet.

    s = (b e − c d) ÷ (a c − b²), t = (a e − b d) ÷ (a c − b²); center = midpoint of the two closest points

    Piping in an IFC file as PCF components ifc/pipes.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Bore of a component

    The bore written for a pipe section.

    bore = nominal diameter for the pipe size, else outside diameter to 1 decimal

    PCF piping files from and to pipe runs mep/pcf-bim.js
    • BimCraft
    64-bit
  • Corner and angle of a bend

    The corner point and turn angle written for an elbow or bend.

    corner = p₀ + d₁ × R tan(θ ÷ 2); angle = θ × 180 ÷ π to 2 decimals

    PCF piping files from and to pipe runs mep/pcf-bim.js
    • BimCraft
    64-bit
  • Where two legs meet

    The corner of an imported elbow from the legs before and after it.

    s = (b e − c d) ÷ (a c − b²), t = (a e − b d) ÷ (a c − b²); corner = midpoint of the two closest points

    PCF piping files from and to pipe runs mep/pcf-bim.js
    • BimCraft
    64-bit
  • Position of a valve along a run

    The distance along an imported run to the point nearest a valve.

    s = Σ earlier leg lengths + clamp((p − a) · d, 0, L), rounded to 1 decimal

    PCF piping files from and to pipe runs mep/pcf-bim.js
    • BimCraft
    64-bit
  • Pipe size for an imported bore

    The standard nominal diameter nearest to a bore that is not a standard size.

    nearest = table value with the least |value − bore|

    PCF piping files from and to pipe runs mep/pcf-bim.js
    • BimCraft
    Exact
  • Distance of a point along the run

    How far along the run's drawn line a point lies, measured from the first point.

    s = Σ earlier leg lengths + clamp((p − a)·d, 0, L)

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Each part's place and center-line length

    The two ends of every pipe, bend and tee along the run, and the part's own center-line length.

    bend: R × θ; tee: 2 × m; straight: |b − a|

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Where the run is cut and where spools break

    The cut positions inside straight pipe and the breaks between spools, from the field welds and the longest spool length.

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Spool length

    The parts of each spool and the spool's total center-line length.

    length = Σ part lengths, in run order

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Cut length of a straight piece

    The length of each straight pipe piece on the spool sheet's cut list.

    length = |b − a|

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Bend angle on the fitting list

    The angle shown for each elbow and the count of like fittings.

    angle = round(θ × 180 ÷ π)

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Pipe length and weight on the bill of materials

    The total cut length of pipe in a spool and its steel weight.

    kg = (kg per m) × Σ cut lengths ÷ 1000

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Duct cut list

    How many stock-length duct pieces each straight duct needs, and the length left over.

    full = floor((L + 0.5) ÷ piece); rest = L − full × piece

    Pipe spools, cut lists and spool sheets mep/spools.js
    • BimCraft
    64-bit
  • Lengths and weights printed on the spool sheet

    The spool length, cut lengths, pipe length and weight as they appear in the PDF.

    printed kg = round(kg × 10) ÷ 10

    Pipe spools, cut lists and spool sheets mep/spool-sheet.js
    • BimCraft
    64-bit
  • Spool sheet CSV rows

    The cut lengths, quantities and pipe weight exported as CSV.

    exported kg = round(kg × 100) ÷ 100

    Pipe spools, cut lists and spool sheets mep/spool-sheet.js
    • BimCraft
    64-bit
  • Axis placement

    The origin and three unit axes of an AXIS2_PLACEMENT_3D.

    z = axis ÷ |axis|; x = (ref − z (ref·z)) ÷ |…|; y = z × x

    STEP curves and surfaces: points from parameters step/geom.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Circle

    The point at an angle on a circle, and the angle of a point.

    P(t) = o + r cos t · x + r sin t · y; t = atan2(l_y, l_x)

    STEP curves and surfaces: points from parameters step/geom.js
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Polyline

    The point at a parameter along a polyline, and the parameter nearest a point.

    P(t) = (1 − f) Pᵢ + f Pᵢ₊₁, i = ⌊t⌋, f = t − i

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

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.