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

  • Cleaning a stored coordinate

    The rounding applied to every coordinate and angle a transform stores.

    |n − round(n)| < 10⁻⁶ → round(n); else round(n × 10⁶) ÷ 10⁶

    Move, rotate and mirror transform.js
    • DetailCraft
    64-bit
  • A member's new rotation

    The rotation that puts a member's section axis where the transform sent it.

    rotation = atan2(−want·u₀, want·v₀) × 180 ÷ π, brought into 0 to 360

    Move, rotate and mirror transform.js
    • DetailCraft
    64-bit
  • A member through the transform

    The new end points, rotation, position, holes and copes of a member.

    Move, rotate and mirror transform.js
    • DetailCraft
    64-bit
  • Mirrored angle with a top or bottom position

    Shifts a mirrored angle's line so the steel lands where the mirror image is.

    d = A·v̂·voff − v̂′·voff; start, end += d

    Move, rotate and mirror transform.js
    • DetailCraft
    64-bit
  • A footing through the transform

    The new position and rotation of a footing.

    rotate: rot + deg; mirror: 2·φ − rot; both brought into 0 to 360

    Move, rotate and mirror transform.js
    • DetailCraft
    64-bit
  • Center of a selection

    The plan middle of the selection, used as the point to rotate about.

    ((x_min + x_max) ÷ 2, (y_min + y_max) ÷ 2, z_min)

    Move, rotate and mirror transform.js
    • DetailCraft
    64-bit
  • Offset of a drag

    The offset a dragged part is moved by: onto a grid node, or in steps.

    node − held point, or round(raw ÷ step) × step

    Move, rotate and mirror transform.js
    • DetailCraft
    64-bit
  • A part's solid for drawing

    The mesh of a part: its profile extruded, with copes cut.

    3D view view3d.js
    • DetailCraft
    32-bit, display only
  • Mitre ends on the mesh

    Moves the end vertices of a mesh onto the mitre's cut plane.

    3D view view3d.js
    • DetailCraft
    32-bit, display only
  • The part under the pointer

    Which part a click hits and where the ray meets it.

    3D view view3d.js
    • DetailCraft
    32-bit, display only
  • Tightest limit of a rule

    The minimum and maximum a rule allows when several ticked packs have it.

    min = max(minᵢ); max = min(maxᵢ)

    Regulation limits in force and how values are written addons/regs/lib/adapter.js
    • CadCraft
    • BimCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Values written in a problem

    How a required or found value is written in a regulation problem, by unit.

    mm: round(v × 10) ÷ 10; m²: round(v × 100) ÷ 100; ratio and U: 2 decimals; R: 1 decimal; count: whole

    Regulation limits in force and how values are written addons/regs/lib/adapter.js
    • CadCraft
    • BimCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Percentages as text

    A percentage written in the panel, in problems and on the code summary sheet.

    round(v × 10) ÷ 10, then the browser's number format with at most one decimal

    Regulation limits in force and how values are written addons/regs/lib/ui.js
    • CadCraft
    • BimCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Values on the code summary sheet

    Required and found values on the printable code summary for a permit set.

    Regulation limits in force and how values are written addons/regs/lib/ui.js
    • CadCraft
    • BimCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Raw double, read

    A 64-bit value read from eight bytes of the bit stream.

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Bit double, read

    A value stored as a two-bit code: a full 64-bit value, exactly 1.0 or exactly 0.0.

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Double with default, read

    A value stored as the bytes in which it differs from a default value.

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • 64-bit whole number, read

    An unsigned 64-bit whole number from two 32-bit halves.

    value = high × 2³² + low

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Bit long long, read

    A whole number of up to seven bytes, the count given by three bits.

    value = Σ byteᵢ × 256ⁱ

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Handle reference, read

    An object handle, absolute or as an offset from another handle.

    value = Σ byte × 256ᵏ; codes 6, 8, A, C: ref + 1, ref − 1, ref + value, ref − value

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Modular char, read

    A signed whole number stored seven bits per byte.

    value = Σ (byte & 0x7F) × 2^(7i); the last byte carries 6 bits and the sign

    Numbers in a DWG file, read and written bit for bit dwg/bits-read.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Raw double, written

    A 64-bit value written as its eight bytes.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Bit double, written

    A value written as a two-bit code for exactly 0.0 or 1.0, or as a full 64-bit value.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Double with default, written

    A value written as a two-bit code when it equals its default, or in full.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Thickness, written

    A thickness written as one bit when it is zero, or as a bit double.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Bit long, written

    A 32-bit whole number in its short or full form.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    Exact
  • Bit short, written

    A 16-bit whole number in its short or full form.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    Exact
  • Bit long long, written

    A 64-bit whole number as a three-bit byte count and its bytes.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    Exact
  • Point, written

    The three coordinates of a point as bit doubles.

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Handle bytes, written

    A handle as its bytes, most significant first.

    byte = v mod 256; v = ⌊v ÷ 256⌋

    Numbers in a DWG file, read and written bit for bit dwg/bits-write.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    Exact
  • Triangulate a polygon with holes

    The triangles of a polygon, as indexes into its point list.

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Winding of a ring

    Whether a ring runs clockwise or counterclockwise.

    sum = Σ (xⱼ − xᵢ) × (yᵢ + yⱼ)

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Orientation of three points

    On which side of the line through two points a third point lies.

    area = (q.y − p.y) × (r.x − q.x) − (q.x − p.x) × (r.y − q.y)

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Removing duplicate and collinear points

    Drops points that repeat their neighbor or lie on the line between their neighbors.

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Ear test

    Whether a corner can be cut off as a triangle: it is convex and no other point of the ring lies inside it.

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Point in triangle

    Whether a point lies inside or on a triangle.

    three cross products of (corner − point) pairs, each ≥ 0

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Bridge from a hole to the outer ring

    The point of the outer ring a hole is connected to.

    x = p.x + (h.y − p.y) × (p′.x − p.x) ÷ (p′.y − p.y); tan = |h.y − p.y| ÷ (h.x − p.x)

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Do two segments cross

    Whether two edges intersect, including touching and collinear overlap.

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Is the middle of a diagonal inside the polygon

    Whether a diagonal between two corners runs through the inside of the polygon.

    midpoint = ((a.x + b.x) ÷ 2, (a.y + b.y) ÷ 2); even-odd count of edges crossed by a ray

    Polygon triangulation (ear clipping) usd/earcut.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    • PartCraft
    64-bit
  • Material a set of cuts needs

    The bar length a group of cuts takes, with trim and saw kerf.

    need = trim + Σ lengths + kerf × cuts

    Cut-list nesting of bars nest.js
    • BimCraft
    • DetailCraft
    64-bit
  • Nesting pieces on stock bars

    Which pieces are cut from which bar, each bar's drop, and the bought, used and waste totals.

    length = round(length × 10) ÷ 10; fits if need ≤ stock + kerf; drop = stock − trim − used − kerf × cuts; waste = 1 − used ÷ bought

    Cut-list nesting of bars nest.js
    • BimCraft
    • DetailCraft
    64-bit
  • Cut list tables

    The summary per profile and the list of bars as printed.

    m = mm ÷ 1000, 2 decimals; waste % = waste × 100, 1 decimal

    Cut-list nesting of bars nest.js
    • BimCraft
    • DetailCraft
    64-bit
  • Mesh handed to the solid kernel

    Welds the mesh's corners and passes it to manifold-3d.

    weld grid = 10⁻⁶ × max(Δx, Δy, Δz); positions → Float32Array

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Boolean of two solids

    The difference, union or intersection of two element meshes.

    c = center of a's box; R = (a − c) OP (b − c); result = R + c

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Element minus all its openings

    Subtracts every opening from an element, one after another.

    A₀ = base − c; Aᵢ = Aᵢ₋₁ − (cutterᵢ − c); result = Aₙ + c

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part
  • Face planes of a convex cutter

    Finds the outward planes of a cutter and decides whether it is convex.

    n = (b − a) × (c − a) ÷ |…|; d = n · a; convex when n · p − d ≤ 10 ε for every corner p

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Polygon split by a plane

    Cuts a convex polygon into the part in front of a plane and the part behind it.

    t = dₐ ÷ (dₐ − d_b); x = a + (b − a) t

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Mesh clipped by a plane

    Keeps the part of a mesh on one side of a plane and closes the cut.

    dᵢ = (pᵢ − p) · n; ε = 10⁻⁹ × (d_max − d_min); cut point = a + (b − a) dₐ ÷ (dₐ − d_b)

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Cap of a cut

    Joins the cut segments into loops, sorts outer loops from holes and fills them.

    key = round(x ÷ tol), round(y ÷ tol), round(z ÷ tol); area = ½ |Σ (xᵢ yᵢ₊₁ − xᵢ₊₁ yᵢ)|

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    64-bit
  • Half-space cut

    Removes the part of an element behind a plane, optionally only inside a polygon boundary.

    L = 4 × max(1, box diagonal) + |P₀ − box min|; prism height = 2 L

    IFC openings, clippings and half-space cuts ifc/geo-bool.js
    • BimCraft
    • TakeoffCraft
    • CivilCraft
    • DetailCraft
    32-bit in part

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.