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

  • 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
  • Meters per drawing unit

    The factor that turns a drawing length into meters.

    inch 0.0254; foot 0.3048; yard 0.9144; mm 0.001; cm 0.01; m 1

    Installation loads and cable lengths addons/electrical/lib/install.js
    • CadCraft
    Exact
  • Number read from an attribute

    Turns attribute text such as a load, voltage or breaker rating into a number.

    Installation loads and cable lengths addons/electrical/lib/install.js
    • CadCraft
    64-bit
  • Load of a library item

    The watts of a placed library item from its kW, amps and volts, or horsepower attributes.

    W = kW × 1000; or A × V (× √3 for three phase); or hp × 746

    Installation loads and cable lengths addons/electrical/lib/install.js
    • CadCraft
    64-bit
  • Load per circuit

    The total watts on each circuit and the circuit's current.

    watts = Σ load of the devices on the circuit

    Installation loads and cable lengths addons/electrical/lib/install.js
    • CadCraft
    64-bit
  • Circuit current

    The current a circuit draws.

    I = W ÷ (V × pf); three phase: I = W ÷ (√3 × V × pf)

    Installation loads and cable lengths addons/electrical/lib/install.js
    • CadCraft
    64-bit
  • RCD trip current from text

    Reads the milliamps a circuit's RCD text names.

    Installation loads and cable lengths addons/electrical/lib/install.js
    • CadCraft
    64-bit
  • Route network

    Builds the network of cable routes: nodes, and edges with their lengths, split where one route's end lands on another.

    split point = a + (b − a) × u; edge length = √(Δx² + Δy²)

    Installation loads and cable lengths addons/electrical/lib/install.js
    • CadCraft
    64-bit
  • Device joined to the nearest route

    Connects a board or device to the nearest point of a route within reach, and counts the drop.

    drop = √d²; split lengths = len × u and len × (1 − u)

    Installation loads and cable lengths addons/electrical/lib/install.js
    • CadCraft
    64-bit
  • Shortest routes from the board

    The shortest distance from the board to every node of the route network.

    Dijkstra: dist[v] = min(dist[v], dist[u] + len)

    Installation loads and cable lengths addons/electrical/lib/install.js
    • CadCraft
    64-bit
  • Cable length of a circuit

    The meters of cable a circuit needs.

    meters = Σ used edges × meters per unit + devices reached × 0.5 + 1

    Installation loads and cable lengths addons/electrical/lib/install.js
    • CadCraft
    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
  • Cable length through each run

    For each cable, the runs it passes through and its length in each.

    length in a run = Σ segment length × 1000 over that run's segments on the path

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

    The length of each cable in the schedule, with slack and an allowance at each end.

    length m = (route mm × (1 + slack) + 2 × ends mm) ÷ 1000, rounded to 0.1

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

    Reads cable tags, outside diameters and counts from a CSV file.

    Conduit and tray fill, cable schedule addons/electrical/lib/mep/carrier.js
    • CadCraft
    • BimCraft
    64-bit
  • Squared distance from a point to a segment

    How far a point is from a wire segment, and where along the segment the nearest point lies.

    u = clamp((p − a)·(b − a) ÷ |b − a|², 0, 1); q = a + u (b − a); d² = |p − q|²

    Schematic wires, pins and connections addons/electrical/lib/wires.js
    • CadCraft
    64-bit
  • Points within a radius

    Finds the stored points within a distance of a point.

    match when (Δx² + Δy²) ≤ r²

    Schematic wires, pins and connections addons/electrical/lib/wires.js
    • CadCraft
    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.