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
  • 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
  • Numbers read from an IES file

    Splits the numeric part of an IES file into numbers.

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.js
    • CadCraft
    • BimCraft
    64-bit
  • IES candela values and luminaire size

    Scales the candela table and converts the luminous opening to millimeters.

    cd = value × multiplier × ballast factor; lumens = lamps × lumens per lamp; size mm = value × 304.8 (feet) or × 1000 (meters)

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.js
    • CadCraft
    • BimCraft
    64-bit
  • Full set of horizontal planes

    Mirrors the horizontal planes of a symmetric IES file to cover 0 to 360 degrees.

    quadrant: a, 180 − a, 180 + a, 360 − a; bilateral: a, 360 − a

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.js
    • CadCraft
    • BimCraft
    64-bit
  • EULUMDAT lamp flux and watts

    Adds up the lamp flux and wattage of the lamp sets in an EULUMDAT file.

    lumens = Σ |count| × flux; watts = Σ watts

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.js
    • CadCraft
    • BimCraft
    64-bit
  • EULUMDAT candela scale

    Turns the file's cd per 1000 lm values into candela.

    cd = value × (lumens ÷ 1000) × (LORL ÷ 100) × conversion factor

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.js
    • CadCraft
    • BimCraft
    64-bit
  • Position in an angle table

    Finds the two table angles on either side of an angle and the fraction between them.

    f = (x − a_lo) ÷ (a_hi − a_lo)

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.js
    • CadCraft
    • BimCraft
    64-bit
  • Candela in a direction

    The luminous intensity at a vertical and horizontal angle, interpolated from the table.

    I = (1 − f_h) (I₀₀ (1 − f_v) + I₀₁ f_v) + f_h (I₁₀ (1 − f_v) + I₁₁ f_v)

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.js
    • CadCraft
    • BimCraft
    64-bit
  • Luminaire axes

    The nadir, C0 and C90 directions of an aimed and rotated luminaire.

    n = aim ÷ |aim|; r₀ = axis − (axis·n) n, normalized; r = r₀ cos t + (n × r₀) sin t

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.js
    • CadCraft
    • BimCraft
    64-bit
  • Illuminance at a point

    The direct illuminance in lux at a point on a surface from all luminaires.

    E = LLF × Σ I(γ, C) × scale × cos θ ÷ d², d in meters

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.js
    • CadCraft
    • BimCraft
    64-bit
  • Calculation grid

    The points the illuminance is computed at: cell centers inside the area at the working height.

    nₓ = max(1, round(width ÷ spacing)); x = x₀ + (width ÷ nₓ) × (i + 0.5)

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.js
    • CadCraft
    • BimCraft
    64-bit
  • Minimum, average, maximum and uniformity

    The statistics of the grid values.

    avg = Σ E ÷ n; uniformity = min ÷ avg; min ÷ max

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.js
    • CadCraft
    • BimCraft
    64-bit
  • Area and lighting power density

    The area in square meters, the total lumens and watts, and the watts per square meter.

    area m² = |Σ (xᵢ yᵢ₊₁ − xᵢ₊₁ yᵢ)| ÷ 2e6; LPD = watts ÷ area

    Luminaire files and point-by-point illuminance addons/lighting/lib/mep/photometry.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.