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

  • Arc move length

    The length of a G2 or G3 move in the XY plane, with any Z change.

    r = |start − center|; sweep = a₁ − a₀ wrapped to the move's direction; len = √((r × |sweep|)² + Δz²)

    G-code dry run and hole check addons/cabinetcraft/lib/dryrun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Arc move extent

    The bounding box of an arc move.

    extent = end points ∪ {center + r × (cos q, sin q)} for q = 0°, 90°, 180°, 270° inside the sweep

    G-code dry run and hole check addons/cabinetcraft/lib/dryrun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Straight move length

    The length and extent of a straight move.

    len = √(Δx² + Δy² + Δz²)

    G-code dry run and hole check addons/cabinetcraft/lib/dryrun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Extent of the whole program

    The smallest and largest X, Y and Z any move reaches.

    G-code dry run and hole check addons/cabinetcraft/lib/dryrun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Total cutting and rapid length

    The summed length of the cutting moves and of the rapid moves.

    cutLen = Σ len over cutting moves; rapidLen = Σ len over rapids

    G-code dry run and hole check addons/cabinetcraft/lib/dryrun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Deepest cut and cut through the stock

    The lowest Z of any cutting move and how far it goes below the bottom of the sheet.

    deepest = min z; through = max(0, −deepest − thickness)

    G-code dry run and hole check addons/cabinetcraft/lib/dryrun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Cutting and rapid time

    The minutes the cutting moves and the rapids take at their feed rates.

    minutesCut = Σ len ÷ feed; minutesRapid = rapidLen ÷ rapid rate

    G-code dry run and hole check addons/cabinetcraft/lib/dryrun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Hole edge distance

    How close the rim of each face hole comes to the edge of its panel.

    e = min(x − r, L − x − r, y − r, W − y − r), r = d ÷ 2

    G-code dry run and hole check addons/cabinetcraft/lib/dryrun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Rounding of reported values

    Rounds a value of the report to 3 decimals.

    r3(v) = round(v × 1000) ÷ 1000

    G-code dry run and hole check addons/cabinetcraft/lib/dryrun.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Amount of one estimate row

    The amount of a row from its quantity and rate.

    amount = round(qty × rate × 100) ÷ 100; shown qty = round(qty × 1000) ÷ 1000

    Cabinet job cost estimate addons/cabinetcraft/lib/estimate.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Price of one sheet

    The price of a sheet of the job's size from the price of the stock sheet.

    rate = round(base × (w × h × k²) ÷ (2440 × 1220), 2 decimals), k = 25.4 for an inch job

    Cabinet job cost estimate addons/cabinetcraft/lib/estimate.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Number of sheets

    How many sheets of a material the job needs.

    nested: sheets used; else n = max(1, ⌈cut area × 1.15 ÷ (w × h)⌉)

    Cabinet job cost estimate addons/cabinetcraft/lib/estimate.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Edge banding length priced

    The meters of each edge banding, with waste, and its rate.

    meters = length ÷ 1000 × k × (1 + waste), k = 25.4 for an inch job

    Cabinet job cost estimate addons/cabinetcraft/lib/estimate.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Frame stock priced

    The price per meter of face-frame stock scaled from a 38 × 19 mm board, and the meters needed.

    rate = base × (width ÷ 38) × (thickness ÷ 19), in mm; meters = length ÷ 1000 × k × 1.1

    Cabinet job cost estimate addons/cabinetcraft/lib/estimate.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Countertop priced

    The price of each countertop from its length and width.

    amount = (length ÷ 1000 × k) × round(base × (width × k ÷ 600), 2 decimals)

    Cabinet job cost estimate addons/cabinetcraft/lib/estimate.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Labor and machine hours

    The labor hours from the count of each cabinet kind, and the machine hours from the number of sheets.

    hours = Σ count × hours per kind + frames × extra; machine = sheets × minutes per sheet ÷ 60

    Cabinet job cost estimate addons/cabinetcraft/lib/estimate.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Subtotal, markup, tax and total

    The totals of the estimate and the cost per cabinet.

    subtotal = Σ amounts; markup = subtotal × rate; tax = (subtotal + markup) × rate; total = subtotal + markup + tax

    Cabinet job cost estimate addons/cabinetcraft/lib/estimate.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • A rate read from a shop's table

    Turns one cell of an imported rate table into a number.

    Cabinet job cost estimate addons/cabinetcraft/lib/estimate.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Rate table lines

    Splits each line of a text rate table into a path and a value.

    Cabinet job cost estimate addons/cabinetcraft/lib/estimate.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Rounding to a number of decimals

    Rounds a value to dp decimals, 6 by default.

    round(v, dp) = Math.round(v × 10^dp) ÷ 10^dp

    Cut list sizes, areas and banding lengths addons/cabinetcraft/lib/cutlist/cutlist.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Cut size of a part

    The size to cut a part so it measures its finished size once the banding is on.

    cut width = width − (t_L1 + t_L2) + premill × banded L edges; cut length = length − (t_W1 + t_W2) + premill × banded W edges

    Cut list sizes, areas and banding lengths addons/cabinetcraft/lib/cutlist/cutlist.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Pieces and areas per material

    The piece count, finished area and cut area of each material and thickness.

    area = Σ qty × length × width; cut area = Σ qty × cut length × cut width

    Cut list sizes, areas and banding lengths addons/cabinetcraft/lib/cutlist/cutlist.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Edge banding length

    The length of each banding, the number of edges, and the length with trim waste.

    length = Σ qty × edge; with waste = Σ qty × (edge + waste per edge)

    Cut list sizes, areas and banding lengths addons/cabinetcraft/lib/cutlist/cutlist.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Rough sheet count

    An estimate of the sheets a material needs, from area only.

    estimate = ⌈round(cut area × (1 + 0.15) ÷ sheet area, 9 decimals)⌉

    Cut list sizes, areas and banding lengths addons/cabinetcraft/lib/cutlist/cutlist.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Parts handed to nesting

    Each part as a rectangle at its cut size for the nesting engine.

    Cut list sizes, areas and banding lengths addons/cabinetcraft/lib/cutlist/cutlist.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Cut list CSV numbers

    Writes the cut list as CSV text.

    number cell = round(v, dp), dp = 2 by default

    Cut list sizes, areas and banding lengths addons/cabinetcraft/lib/cutlist/cutlist.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Arcs to chords

    Turns a loop with bulges into points, with each arc as chords no further than the sag from it.

    θ = 4 atan(b); r = chord ÷ (2 sin(|θ| ÷ 2)); steps = ⌈|θ| ÷ (2 acos(1 − min(sag, r) ÷ r))⌉

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Area of a loop with arcs

    The signed area of a closed loop, with each arc's segment included.

    2A = Σ (xᵢ yᵢ₊₁ − xᵢ₊₁ yᵢ) + Σ sign(θ) r² (|θ| − sin|θ|)

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Area of a part

    A part's area: its outline less its holes.

    area = |A₀| − Σ |Aₖ|

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • A part moved to its place

    Rotates, mirrors and moves a part's loops to their position on the sheet.

    q = (x, y) + R(rot) · (m pₓ, p_y), m = −1 when mirrored; bulge × m

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Turns a part may take

    The rotation angles tried for a part, from its grain and the turn step.

    no grain: rot = k × 2π ÷ n, n = round(360 ÷ step); grain: rot = −g (+ π) ± tolerance

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • A shape on the raster

    Marks every grid cell a part touches.

    cell i = ⌊(x − oₓ) ÷ res⌋; edge cells from the segment's lowest and highest point in each column

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Raster cell size and clearance

    The cell size of the raster, the arc sag, and the number of cells kept clear around each part.

    res = max((h − 2 margin) ÷ 750, 1e-6), at most smallest ÷ 4; sag = min(res ÷ 8, 0.1); grow = ⌈(spacing + 2 sag) ÷ res − 1e-9⌉

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Placed position of a part

    The position of each placed part in sheet coordinates.

    x = margin + gₓ × res − shape origin x; y = margin + g_y × res − shape origin y

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Used length and efficiency

    The length used on each sheet and the share of the sheet area the parts cover.

    used = max x of the placed outlines + margin; efficiency = Σ part area ÷ (sheets × w × h), or ÷ (used × h) on a roll

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Distance between two edges

    The shortest distance between two segments, 0 when they cross.

    0 when the cross-product signs differ on both segments; else min of the four end-point-to-segment distances

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Re-check of a nest

    Checks that no two placed parts overlap or come closer than the spacing, and that all lie inside the margins.

    outside when the bounding box passes a margin by more than eps; overlap when d ≤ eps or one part's first point is inside the other; close when d < gap − eps

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Lines and arcs joined into loops

    Joins separate line and arc pieces into closed loops where their ends meet.

    ends meet when their distance ≤ 1.5 × tol

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Bulge of an arc

    The bulge value of an arc from its sweep in degrees.

    bulge = tan(sweep × π ÷ 180 ÷ 4)

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Flat pattern pieces to loops

    Turns line, arc, circle and polyline pieces of a flat pattern into closed loops with bulges.

    arc end = c + r (cos a, sin a); sweep = (a₁ − a₀) mod 360; circle = two bulges of 1

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Arcs and ellipses read from DXF

    Reads ARC and ELLIPSE entities into pieces or loops.

    ellipse: n = max(8, ⌈sweep ÷ (2π ÷ 96)⌉) points at equal parameter steps

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Joining tolerance for a DXF

    The distance within which loose line and arc ends of a DXF are joined.

    tol = max(1e-6, 1e-7 × largest absolute coordinate)

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Outlines and their holes

    Sorts loops into parts: an outline and the holes directly inside it.

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Numbers written to the DXF

    Formats every coordinate, bulge and text height of the nest DXF.

    text = v.toFixed(6) with trailing zeros removed; |v| < 1e-12 written as 0

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Sheets stacked in the DXF

    The y offset of each sheet in the written DXF.

    offset₀ = 0; offsetₛ₊₁ = offsetₛ − (Hₛ + gap), gap = 0.1 × tallest sheet by default

    Sheet nesting addons/cabinetcraft/lib/nest/nest.js
    • CadCraft
    • BimCraft
    • ModelCraft
    • PartCraft
    64-bit
  • Cross-section of the cables

    The total cross-sectional area of a set of cables.

    area = Σ (π ÷ 4) × od² × n

    Conduit and tray fill, cable schedule addons/electrical/lib/mep/carrier.js
    • CadCraft
    • BimCraft
    64-bit
  • Conduit fill

    The percentage of a conduit's inside area the cables take, and whether it is within the limit.

    pct = 100 × used ÷ (π ÷ 4 × id²); free = area × limit ÷ 100 − used

    Conduit and tray fill, cable schedule addons/electrical/lib/mep/carrier.js
    • CadCraft
    • BimCraft
    64-bit
  • Smallest conduit that holds the cables

    The first trade size, going up, whose fill is within the limit.

    Conduit and tray fill, cable schedule addons/electrical/lib/mep/carrier.js
    • CadCraft
    • BimCraft
    64-bit
  • Cable tray fill

    The fill of a tray by area, or by the sum of cable diameters when the cables lie in one layer.

    area mode: pct = 100 × used ÷ (width × depth); layer mode: pct = 100 × Σ (od × n) ÷ width

    Conduit and tray fill, cable schedule addons/electrical/lib/mep/carrier.js
    • CadCraft
    • BimCraft
    64-bit
  • Shortest way through the carriers

    The shortest path between two nodes of the tray and conduit network, and its length.

    Dijkstra: d = dist[u] + segment length × 1000

    Conduit and tray fill, cable schedule addons/electrical/lib/mep/carrier.js
    • CadCraft
    • BimCraft
    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.