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
-
A measured length as text
The text of a seam length or walk difference on the command line.
mm: 1 decimal, 0 below 0.05; inches: fractions to 1/16
Apparel commands: piece table, marks and marker output addons/apparel/main.js64-bit- CadCraft
-
Stock list read from a file
A stock list with every number checked and each remnant's area, width and height worked out again from its outline.
area = regionArea(loops); w = x₁ − x₀; h = y₁ − y₀ of the outline (arcs flattened to a sag of 0.001); outline moved so its box corner is (0, 0)
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.js64-bit- CadCraft
- PartCraft
-
Stock totals
The number of available remnants and their total area per material and thickness.
area = Σ remnant areas
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.js64-bit- CadCraft
- PartCraft
-
Numbers in the stock CSV
The text of a thickness, width, height or area in the exported stock list.
round(v × 10ᵈ) ÷ 10ᵈ; d = 3 for thickness, 2 for width and height, 1 for area
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.js64-bit- CadCraft
- PartCraft
-
Grid of free material
Marks which cells of the plate are free after the parts, the spacing and narrow strips are taken out.
cell = min(w, h) ÷ 600; sag = min(cell ÷ 8, 0.1); grow = ⌈(spacing + 2·sag) ÷ cell − 1e-9⌉ + 1 cells; strips narrower than minWidth removed by an opening of ⌊minWidth ÷ cell ÷ 2⌋ cells
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.js64-bit- CadCraft
- PartCraft
-
Growing a region on the grid
Marks every cell within k cells of a marked cell, along rows and then columns.
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.jsExact- CadCraft
- PartCraft
-
Outline of a free region
The boundary of one connected region of free cells, as loops on grid corners.
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.jsExact- CadCraft
- PartCraft
-
Removing points on a straight run
Drops grid points that lie between their neighbors on a straight line.
(b − a) × (c − b) ≠ 0 → keep
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.jsExact- CadCraft
- PartCraft
-
Simplifying an outline
Removes outline points within half a cell of the simplified line.
d = |(r − p) × (q − p)| ÷ |q − p|; kept when d > tol
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.js64-bit- CadCraft
- PartCraft
-
Remnant outline, size and area
Each leftover region as an outline with holes, its area and its bounding size.
point = grid corner × cell, clamped to the plate; simplified by cell ÷ 2; area = regionArea(outline and holes); kept when area ≥ minArea (2 percent of the plate by default)
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.js64-bit- CadCraft
- PartCraft
-
Does a remnant match the job
Whether a remnant has the job's material and thickness.
|thickness − wanted| < 1e-6
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.js64-bit- CadCraft
- PartCraft
-
Job efficiency
The share of the material used by the parts over all remnants and plates of a job.
efficiency = Σ part areas ÷ Σ (remnant area or w × h of each plate)
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.js64-bit- CadCraft
- PartCraft
-
Adding a job's remnants to the stock
Marks the remnants a job used and adds the ones it leaves, numbered.
stored outline = outline − (x₀, y₀); w, h and area as found by leftovers
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.js64-bit- CadCraft
- PartCraft
-
Exact re-check of remnants against parts
Confirms on the polygons that no remnant touches a placed part and that the spacing is kept.
distance between every pair of edges; overlap when ≤ 1e-6 or one contains the other's first point; too close when < spacing − 1e-6
Offcut stock after nesting addons/apparel/lib/nest/nest-stock.js64-bit- CadCraft
- PartCraft
-
Millimeters in one drawing unit
The factor from the drawing's unit to millimeters.
mm per unit = meters per unit ÷ 0.001; inch 0.0254, foot 0.3048, yard 0.9144, cm 0.01, m 1
CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js64-bit- CadCraft
-
Room outline from a polyline
The corners of a closed polyline in millimeters, with arcs turned into chords.
sweep = 4·atan(bulge); steps = max(1, ⌈|sweep| ÷ 15°⌉); r = chord ÷ (2·sin(|sweep| ÷ 2)); point = (c + r·(cos, sin)) × f
CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js64-bit- CadCraft
-
Drawing units per job unit
The factor that scales the cabinet job (millimeters or inches) to the drawing's unit.
k = (25.4 or 1) ÷ mm per drawing unit
CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js64-bit- CadCraft
-
Room area in the list
The floor area shown beside each closed polyline offered as a room.
area = |Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)| ÷ 2 ÷ 1e6 m²; shown as round(area × 100) ÷ 100
CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js64-bit- CadCraft
-
Door and window openings read from blocks
The position and width of each door or window block near the room.
w = max(box width, box height) × f, limited to 300…3000 mm; position = insertion point × f
CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js64-bit- CadCraft
-
Where the sheets are drawn
The point in the drawing where the shop drawing sheets start.
intended: x = right edge of what is drawn + 0.3 × tallest sheet; y = its top edge
CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js64-bit- CadCraft
-
Cabinet solids for the 3D tab
The faces of each cabinet as polygons in drawing units.
point = (x ÷ f, y ÷ f, z ÷ f)
CabinetCraft in a drawing: units, room outline and solids addons/cabinetcraft/host.js64-bit- CadCraft
-
Turning a direction
A direction turned by an angle in degrees.
(x·cos a − y·sin a, x·sin a + y·cos a), each rounded to 6 decimals
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Turn between two walls
The signed angle from one wall direction to the next, in degrees.
atan2(u₀ × u₁, u₀ · u₁) × 180 ÷ π
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
End of a wall typed as length and angle
The end point of a wall from its start, length and angle.
(x + L·cos a, y + L·sin a), rounded to 6 decimals
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
End of an arc typed as radius and sweep
The end point of an arc wall from its radius, sweep and the heading of its chord.
chord = 2·R·sin(|sweep| ÷ 2); end = start + chord at the heading
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Sagitta
How far the middle of a straight back of width w stands off a circle of radius r.
s = r − √(r² − w² ÷ 4)
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Arc through three points
The radius, center and signed sweep of the arc picked as start, middle and end.
d = 2·(aₓ(bᵧ − cᵧ) + bₓ(cᵧ − aᵧ) + cₓ(aᵧ − bᵧ)); uₓ = Σ |p|²·(Δy) ÷ d; uᵧ = Σ |p|²·(Δx) ÷ d; r = |a − u|
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Arc from two ends and a sweep
The radius, center, chord, arc length and sagitta of an arc wall.
r = chord ÷ (2·sin(θ ÷ 2)); center = middle ± normal × r·cos(θ ÷ 2); arc length = r·θ; sagitta = r·(1 − cos(θ ÷ 2))
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Points along an arc wall
An arc wall as n straight pieces.
φᵢ = a₀ ± |θ|·i ÷ n; point = center + r·(cos φ, sin φ), rounded to 6 decimals
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Back line and half angle of each cabinet on an arc
The radius of each cabinet's back line and the half angle it takes up.
bay: H = √(R² − w² ÷ 4); bow or curved front: H = R; half angle = atan2(w ÷ 2, H), or w ÷ (2R) for a curved front; front radius = H − d
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Spacing cabinets round an arc
The angle at which each next cabinet stands so that it just clears the one before.
bisection on the angle step in 0…π ÷ 2, 60 halvings; clash when the footprints penetrate more than 1e-7
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Gaps and wedges between stepped cabinets
The largest gap between each cabinet's back and the curve, and the wedge left between neighbors.
bay gap = R − H; bow gap = √(R² + w² ÷ 4) − R; wedge back and front = distance between neighboring corners
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Length used along the arc
How much of the arc the cabinets take, and by how much the last one passes the end.
used = (end angle − start angle) × R; overflow = max(0, end angle − limit) × R
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Stop short of an angled corner
How far a run of cabinets must stop before a convex corner.
τ ≤ 90°: depth × sin τ; sharper: depth
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Void at an angled corner
The right-triangle void left where a run stops short of an angled corner.
leg₁ = d·sin τ; leg₂ = d·cos τ; area = leg₁·leg₂ ÷ 2
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Diagonal corner cabinet at any angle
The outline, miter, front length and area of a diagonal-front corner cabinet at a corner of turn τ.
ℓ = w − d·tan(τ ÷ 2); front = 2·ℓ·cos(τ ÷ 2); apex = 180° − τ; miter angle = 90° − τ ÷ 2; Q = (w − d·tan(τ ÷ 2), d)
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Area of a footprint
The area of a polygon.
A = |Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)| ÷ 2
Cabinets on angled and curved walls addons/cabinetcraft/lib/angled.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
A board along a slanted line
The four corners of a door or plinth board that runs along a diagonal.
n = (−Δy, Δx) ÷ L; corner = point + n × offset, rounded to 6 decimals
Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Round shelf solid
The outline of a lazy-susan shelf as drawn in 3D.
20 points at (cx + r·cos(2πi ÷ 20), cy + r·sin(2πi ÷ 20))
Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Open leg of a corner cabinet
The basic sizes of a corner cabinet: width, depth, open leg and top height.
a = w − d; top = kick + box height
Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Lazy-susan shelf size and place
The diameter and center of the round shelves and the pole they turn on.
diameter = max(1, w − 2·(t + 70 mm)); clearance = back setback + back thickness + 12 mm; center = (w − r − clearance, r + clearance); pole = center ± 15
Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Shelf heights
The height of each shelf inside the cabinet.
z = kick + t + (inside height) × (i + 1) ÷ (n + 1) − t ÷ 2
Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Sizes entered in the cut list
The length and width of each board as they go into the cut list.
length, width → round(v × 1e6) ÷ 1e6
Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Back panels
The size of the two back panels for a grooved, between or applied back.
grooved: height = box height − 2t + 2·groove, length + groove; between: height = box height − 2t; applied: full height and width
Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Door and plinth sizes at a right-angled corner
The door height and width and the plinth length of a corner cabinet.
door height = box height − reveal; door width = a − reveal (L) or a·√2 − reveal (diagonal); plinth = a or a·√2
Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Blank for the triangle of an angled corner
The smallest rectangle the triangular filler of an angled corner cabinet can be cut from, and the true front length.
axes along the triangle's first leg and across it; L = largest coordinate along, W = largest across; front = |F_B − F_A|
Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Door and plinth sizes at an angled corner
The door and plinth of a diagonal corner cabinet at a corner that is not a right angle.
door width = front length − reveal; plinth = front length
Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Mirrored corner cabinet
The same cabinet for a corner at the start of a run.
x → w − x, rounded to 6 decimals
Corner cabinets: parts and solids addons/cabinetcraft/lib/corner.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Rounding to 4 decimals
Rounds a coordinate to 4 decimals.
r4(v) = round(v × 1e4) ÷ 1e4
Cabinet shop drawings as drawing objects addons/cabinetcraft/lib/cadents.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
-
Drawing item to drawing object
A line, outline or text of a shop drawing as a CadCraft object.
x, y, text height → r4; text rotation = degrees × π ÷ 180
Cabinet shop drawings as drawing objects addons/cabinetcraft/lib/cadents.js64-bit- CadCraft
- BimCraft
- ModelCraft
- PartCraft
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.