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

  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Closing an outline

    Drops repeated points of a profile curve and its closing point.

    IFC curves and profiles as point lists ifc/geo-profile.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • 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.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Area of a written profile

    The cross-section area of an element in a written file, from its rectangle, circle or polygon.

    circle: π r²; polygon: |Σ (xₐ y_b − x_b yₐ)| ÷ 2; rectangle: w × d

    IFC 4.3 infrastructure quantities and files ifc/ifc43.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Quantities written for an element

    The length, width, height, footprint area and volume written to an element's quantity set.

    Length = longer side; Width = shorter side; GrossVolume = area × height

    IFC 4.3 infrastructure quantities and files ifc/ifc43.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
  • Size in millimeters

    The width and height of the copied area, on paper or at the drawing's real size.

    paper: mm = pixels × ptPerPx × (25.4 ÷ 72); real: mm = pixels × mmPerPx

    Size of a copied area areaclip.js
    • CadCraft
    • BimCraft
    • MarkupCraft
    • DetailCraft
    64-bit
  • Render size in pixels

    The pixel width and height for an area given in points at a resolution, lowered so neither side passes the cap.

    d = dpi × min(1, maxPx ÷ (longer side × dpi ÷ 72)); w = round(wPt × d ÷ 72); h = round(hPt × d ÷ 72)

    Size of a copied area areaclip.js
    • CadCraft
    • BimCraft
    • MarkupCraft
    • DetailCraft
    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.