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.
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Area of a part
A part's area: its outline less its holes.
area = |A₀| − Σ |Aₖ|
Sheet nesting addons/cabinetcraft/lib/nest/nest.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Outlines and their holes
Sorts loops into parts: an outline and the holes directly inside it.
Sheet nesting addons/cabinetcraft/lib/nest/nest.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
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.