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
-
Splitting a loop at distances along it
Cuts a loop at given distances from its start, used for tabs and ramps.
t = (cut − length so far) ÷ piece length
2D curve offsets for toolpaths cam-offset.js64-bit- PartCraft
-
Depth levels
The heights of the passes between the top and the bottom of a cut.
n = ceil((top − bottom) ÷ stepdown − 1e-9); z_i = top − (top − bottom)(i + 1) ÷ n; last = bottom
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Clearance, retract and cut heights
The heights an operation moves at, from the stock top and the operation's settings.
clearance = stock top + clearance; retract = min(clearance, stock top + retract); bottom = geometry bottom + offset
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Arc move with changing height
Writes one line or arc as moves, splitting an arc into half turns and sharing the height change among them.
z after a piece = z + (z₁ − z₀) × piece length ÷ arc length; last piece ends at z₁
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Ramp along a path
Lowers the tool linearly while it follows a chain of lines and arcs.
z = z₀ + (z₁ − z₀) × length so far ÷ total length
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Facing rows
The positions of the back-and-forth rows that face the stock.
n = ceil(width ÷ (stepover × d) − 1e-9); row_i = b₀ + (b₁ − b₀) i ÷ n; run from a₀ − R − overhang to a₁ + R + overhang
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Pocket offset levels
The successive inward offsets a pocket is cleared along.
level k at distance d₀ + k × stepover, until nothing is left
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Helix entry
The half-turn arcs that take the tool down into a pocket at a set ramp angle.
pitch = 2π ρ tan(angle); half turns = ceil((z_from − z) ÷ (pitch ÷ 2) − 1e-9); z after half turn i = z_from − (z_from − z)(i + 1) ÷ n
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Ramp entry along a loop
How far along the first loop the tool travels while ramping down a level.
length needed = (z_from − z) ÷ tan(angle); whole loops = floor(needed ÷ L); remainder split off the loop
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Contour offset
The path of the tool center round an outline.
d = R + stock to leave; outside: offset by −d (grow); inside: offset by +d
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Lead-in and lead-out arcs
Quarter-circle arcs that bring the tool onto and off a contour through the air side.
center = start + ρ × left normal; quarter turn ending (or starting) at the contour's start; ρ halved up to 4 times until the arc is in air
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Holding tabs
Where the tool lifts over tabs that keep the part attached.
tab k centered at (k + ½) L ÷ tabs; lifted over tab width + tool diameter; tab top = bottom + tab height
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Drill depth and R plane
How deep each hole is drilled and the height the drill returns to between holes.
through: z = bottom − breakthrough − (tip length when full diameter is asked); R = min(retract, highest stock or part near the hole + R plane)
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Highest point between two holes
The highest part or stock under the drill as it moves from one hole to the next.
max of heights at 9 points across the tool, every 1 mm along the move
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Chamfer depth and offset
How deep and how far out a chamfer mill runs to cut a chamfer of a given width.
β = tool angle ÷ 2; depth = width ÷ tan β; offset = tip radius + tip offset × tan β; z = edge height − depth − tip offset
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Engagement angle of adaptive clearing
The angle of the cutter's rim in material for a set cutting width, listed with the operation.
angle = acos(1 − min(1, w ÷ R)) × 180 ÷ π
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Length of a toolpath segment
The length of a straight or helical move, used for the machining time.
line: |b − a|; arc: √((|sweep| × r)² + Δz²)
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Points along a toolpath segment
Sample points along an arc move for the simulation overlay and checks.
step angle = 2 acos(1 − tol ÷ r); point i at a₀ + sweep × i ÷ n, z linear
2.5-axis toolpaths cam-paths.js64-bit- PartCraft
-
Unit factors
The factor from the file's units to millimeters.
mm 1; cm 10; m 1000; in 25.4
Nested sheets from DXF to toolpaths cam-sheets.jsExact- PartCraft
-
Bulged segments to arcs
Turns a polyline with bulges into lines and true arcs.
r = (d ÷ 2)(1 + b²) ÷ (2|b|); offset = (d ÷ 2)(1 − b²) ÷ (2b); sweep = 4 atan(b)
Nested sheets from DXF to toolpaths cam-sheets.js64-bit- PartCraft
-
Extent of an outline
The box round a sheet or a part outline, used for sheet size and for placing parts on sheets.
min and max over points sampled along each piece at 0.05 chord tolerance
Nested sheets from DXF to toolpaths cam-sheets.js64-bit- PartCraft
-
Part coordinates on its sheet
Moves a part's points so its sheet's lower left corner is the origin, in millimeters.
x′ = (x − sheet x₀) × k; y′ = (y − sheet y₀) × k
Nested sheets from DXF to toolpaths cam-sheets.js64-bit- PartCraft
-
Matrix product
The product of two dense matrices.
C_ij = Σ_p A_ip × B_pj
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
LU factorization
Factors a square matrix with row exchanges.
P A = L U
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
Solve with an LU factorization
Forward and back substitution for one or more right-hand sides.
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
Cholesky factorization
Factors a symmetric positive definite matrix as RᵀR.
R_jj = √(A_jj − Σ_k R_kj²)
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
Solve with a Cholesky factorization
Solves RᵀR X = B by two triangular substitutions.
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
QR factorization
Factors a matrix as an orthogonal matrix times an upper triangular one.
H = I − β v vᵀ, β = 2 ÷ (vᵀv)
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
Symmetric eigenvalues and vectors
All eigenvalues, and optionally eigenvectors, of a symmetric matrix, in ascending order.
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
Generalized symmetric eigenproblem
Eigenvalues and vectors of K v = λ M v for symmetric K and positive definite M.
M = RᵀR; C = R⁻ᵀ K R⁻¹; C y = λ y; v = R⁻¹ y
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
Choice of solver for A x = b
Picks the method for the backslash operator and linsolve, for dense and sparse matrices.
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
Matrix inverse
The inverse of a square matrix.
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
Determinant
The determinant of a square matrix.
det A = sign × Π U_ii
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
Vector and matrix norms
The 1, 2, infinity, p and Frobenius norms.
‖x‖₂ = √(Σ xᵢ²); ‖A‖₂ = √(λ_max(AᵀA))
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
Condition number
The 2-norm condition number of a matrix.
cond A = √(λ_max(AᵀA) ÷ λ_min(AᵀA))
CraftScript dense linear algebra cs-lib-linalg.js64-bit- PartCraft
-
Sparse matrix from triplets
Builds a sparse matrix from row, column and value lists, adding values that share a place.
CraftScript sparse matrices and direct factorization cs-lib-linalg.js64-bit- PartCraft
-
Weighted sum of two sparse matrices
a·A + b·B for matrices of the same size.
C_ij = a × A_ij + b × B_ij
CraftScript sparse matrices and direct factorization cs-lib-linalg.js64-bit- PartCraft
-
Sparse matrix times vector
The product of a sparse matrix and a vector.
y_r = Σ_k val_k × x_col(k)
CraftScript sparse matrices and direct factorization cs-lib-linalg.js64-bit- PartCraft
-
Sparse matrix times sparse matrix
The product of two sparse matrices.
CraftScript sparse matrices and direct factorization cs-lib-linalg.js64-bit- PartCraft
-
Symmetry test
Decides whether a sparse matrix is symmetric, which selects the solver.
max |S − Sᵀ| ≤ 1e-10 × max |S|
CraftScript sparse matrices and direct factorization cs-lib-linalg.js64-bit- PartCraft
-
Envelope size after reordering
Counts the stored entries and the work of the skyline factorization for an ordering.
entries = Σ wᵢ; work = Σ wᵢ² ÷ 2, wᵢ = i − firstᵢ + 1
CraftScript sparse matrices and direct factorization cs-lib-linalg.js64-bit- PartCraft
-
Envelope Cholesky factorization and solve
Factors a symmetric positive definite sparse matrix and solves with the factor.
L_ij = (A_ij − Σ_k L_ik L_jk) ÷ L_jj; L_ii = √(A_ii − Σ_k L_ik²)
CraftScript sparse matrices and direct factorization cs-lib-linalg.js64-bit- PartCraft
-
Assembly of element matrices
Adds weighted element matrices into one sparse matrix.
K = Σ_e w_e × P_eᵀ Ke P_e
CraftScript sparse matrices and direct factorization cs-lib-linalg.js64-bit- PartCraft
-
One operator on two numbers
Adds, subtracts, multiplies, divides, compares or takes the remainder of two numbers.
mod(x, y) = x − ⌊x ÷ y⌋ × y; rem(x, y) = x − trunc(x ÷ y) × y
CraftScript array arithmetic cs-tensor.js64-bit- PartCraft
-
Hypotenuse
√(x² + y²) for two numbers.
m × √((x ÷ m)² + (y ÷ m)²), m = max(|x|, |y|)
CraftScript array arithmetic cs-tensor.js64-bit- PartCraft
-
Power
x raised to the power y.
CraftScript array arithmetic cs-tensor.js64-bit- PartCraft
-
Elementwise loops
Applies an operator to every element of one or two arrays.
CraftScript array arithmetic cs-tensor.js64-bit- PartCraft
-
Matrix product
The product of two dense matrices in a script expression.
C_ij = Σ_p A_ip × B_pj
CraftScript array arithmetic cs-tensor.js64-bit- PartCraft
-
Backslash for dense matrices
Solves A x = b, or the least-squares problem when A is not square.
CraftScript array arithmetic cs-tensor.js64-bit- PartCraft
-
Number of elements in a range
How many values a:s:b has.
n = ⌊(b − a) ÷ s + max(3ε × max(|a|, |b|) ÷ |s|, 1e-10)⌋ + 1
CraftScript array arithmetic cs-tensor.js64-bit- 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.