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
-
Quadrature nodes and weights
The eight points and weights used to integrate the path's speed.
Pattern along a path brep-bodies.js64-bit- PartCraft
-
Length of the path
The arc length of the path and the running length at each piece boundary.
piece length = h Σ wᵢ |C′(m + h xᵢ)|, h = (b − a) ÷ 2, m = (a + b) ÷ 2; L = Σ pieces
Pattern along a path brep-bodies.js64-bit- PartCraft
-
Parameter at an arc length
Finds the curve parameter that lies a given length along the path.
tₙ₊₁ = tₙ − (s(tₙ) − s) ÷ |C′(tₙ)|, kept inside the bracket by bisection
Pattern along a path brep-bodies.js64-bit- PartCraft
-
Path point nearest the seed
The arc length of the path point closest to the center of what is copied.
root of (C(s) − p) · C′(s) = 0 by bisection, beside the nearest of 8 samples per piece
Pattern along a path brep-bodies.js64-bit- PartCraft
-
Turn of each copy
Rotates each copy so it follows the path's direction without twisting.
R ← rot(t_prev → t) × R, in n = ⌈distance ÷ (L ÷ 2000)⌉ steps between stations
Pattern along a path brep-bodies.js64-bit- PartCraft
-
Modal coordinate word
Decides whether an address word such as X or Z is written on a line, and writes its value.
written when round(v × 1000) ≠ round(last × 1000); text = letter + v to 3 decimals
G-code written by text post definitions cam-postdef.js64-bit- PartCraft
-
Numbers in a line template
Fills the {variable} holes of a raw, comment or word template with values.
G-code written by text post definitions cam-postdef.js64-bit- PartCraft
-
Whole-number filter
The int filter a post can put on a value, for example a spindle speed.
int(s) = round(number(s))
G-code written by text post definitions cam-postdef.js64-bit- PartCraft
-
Arc center offsets I and J
The center of an arc move, written relative to the start point.
I = round₃(cₓ − round₃(X_last)); J = round₃(c_y − round₃(Y_last))
G-code written by text post definitions cam-postdef.js64-bit- PartCraft
-
Equality in post conditions
The == and != tests a post definition can make on two values.
G-code written by text post definitions cam-postdef.js64-bit- PartCraft
-
Stock size variables
The stock's diameter, side lengths and corners that a post can print in its header.
sx = maxₓ − minₓ; d = 2 × r
G-code written by text post definitions cam-postdef.js64-bit- PartCraft
-
Scalar arithmetic and comparison
Adds, subtracts, multiplies, divides and compares two plain numbers.
a + b, a − b, a × b, a ÷ b, a < b, a = b
CraftScript operators in the interpreter cs-vm.js64-bit- PartCraft
-
Matrix multiply, divide and power
The *, /, \ and ^ operators on matrices.
A ÷ B = (solve(Bᵀ, Aᵀ))ᵀ; Aⁿ by repeated squaring; A⁻ⁿ = (A⁻¹)ⁿ
CraftScript operators in the interpreter cs-vm.js64-bit- PartCraft
-
Values of a counted loop
The value the loop variable takes on each pass of for x = a:s:b.
xₖ = a + k × s; last value = b when |xₖ − b| < 10⁻¹⁰ × max(1, |b|)
CraftScript operators in the interpreter cs-vm.js64-bit- PartCraft
-
Number text in the echo
The text printed for a number when a statement has no semicolon.
integer below 10¹⁵: all digits; otherwise 5 significant digits
CraftScript values: storage, reading and number text cs-values.js64-bit- PartCraft
-
Matrix text in the echo
The text printed for a vector or matrix.
CraftScript values: storage, reading and number text cs-values.js64-bit- PartCraft
-
Arrays read from a saved workspace
Checks and copies a numeric array from a part file or a worker message.
CraftScript values: storage, reading and number text cs-values.js64-bit- PartCraft
-
Minimum and maximum of a variable
The range shown for each variable in the Variables panel.
CraftScript values: storage, reading and number text cs-values.js64-bit- PartCraft
-
Numeric data as 64-bit
Gives builtins a Float64Array of any numeric value.
CraftScript values: storage, reading and number text cs-values.js64-bit- PartCraft
-
Number and position text
How a number and a position are turned into text for the script.
number → 12 significant digits; position → 9 decimals, then 12 significant digits
Numbers in a PartCraft script file script.js64-bit- PartCraft
-
Sketch geometry and dimensions
Writes a sketch's points, circles, relations and dimension values.
Numbers in a PartCraft script file script.js64-bit- PartCraft
-
A feature value read from a script
Reads a setting such as a depth, given as a number or as an expression.
Numbers in a PartCraft script file script.js64-bit- PartCraft
-
Vertex placement and unit scale
Moves every mesh vertex to where the file places it and converts it to the part's unit.
p′ = (M · p) ÷ w × s; s = meters per file unit × 1000
3DM mesh import: placement and units mesh3dm.js64-bit- PartCraft
-
Combined block placement
Multiplies the placement of a block by the placement of the block inside it.
(A · B)ᵢⱼ = Σₖ Aᵢₖ × Bₖⱼ
3DM mesh import: placement and units mesh3dm.js64-bit- PartCraft
-
Scaled triangles packed for export
Turns the scaled triangles back into a mesh for the file writers.
Scaled mesh for printing print-export.js32-bit in part- PartCraft
-
Triangles of the part's mesh
Reads the part's mesh as a list of triangles for the scaling and splitting code.
Scaled mesh for printing print-export.js64-bit- PartCraft
-
Scaled STL or 3MF file
Builds the file a person downloads from the Scale for printing dialog.
Scaled mesh for printing print-export.js32-bit in part- PartCraft
-
Mesh points in meters, Z up
Converts the part's mesh vertices for the USD file.
(x, y, z) mm → (x, −z, y) ÷ 1000 m
USD export of a part or assembly usd-partcraft.js64-bit- PartCraft
-
Instance placement
Turns an assembly instance's placement matrix from millimeters, Y up, to meters, Z up.
M′ = A · M · A⁻¹; translation ÷ 1000
USD export of a part or assembly usd-partcraft.js64-bit- PartCraft
-
Volume and mass attributes
The volume in cubic meters and the mass in kilograms written on each part.
volume m³ = V mm³ × 10⁻⁹; mass kg = V mm³ × ρ g/cm³ × 10⁻⁶
USD export of a part or assembly usd-partcraft.js64-bit- PartCraft
-
Parameter values per variant
The value each driving parameter ends up with in each variant.
value = parameter to 12 significant digits
Variant pack: parameter table, sizes and library bodies variants.js64-bit- PartCraft
-
Numbers in variants.csv
How a table value is written into the CSV file.
Variant pack: parameter table, sizes and library bodies variants.js64-bit- PartCraft
-
Size of a variant
The width, depth and height of each variant written to variants.json.
size = max − min per axis, to 4 decimals
Variant pack: parameter table, sizes and library bodies variants.js64-bit- PartCraft
-
Volume written per variant
The volume_mm3 figure of each variant in variants.json.
volume to 9 significant digits
Variant pack: parameter table, sizes and library bodies variants.js64-bit- PartCraft
-
Variant body in library coordinates
Turns a variant's mesh to Z up, anchors it at the back middle bottom and rounds it for the library item.
(x, y, z) → (x, −z, y), shifted to the anchor, rounded to d decimals
Variant pack: parameter table, sizes and library bodies variants-item.js64-bit- PartCraft
-
Rounding helper
Rounds a value to a number of decimals for the library item.
r(v, d) = round(v × 10ᵈ) ÷ 10ᵈ
Variant pack: parameter table, sizes and library bodies variants-item.js64-bit- PartCraft
-
Readout rounding and flux units
The text of each number in the results panel.
text = v to p significant digits (p = 4 by default); flux in mWb when |Φ| ≥ 10⁻³ Wb, else µWb
Magnetics add-on: readouts in the panel addons/magnetics/main.js64-bit- PartCraft
-
Air box size
The width and height of the air box shown under the setup.
margin = max(width, height) × pad; box = extent + 2 × margin
Magnetics add-on: readouts in the panel addons/magnetics/main.js64-bit- PartCraft
-
Body, volume and area from a field
The mesh that to_body returns, with its volume, area and triangle count.
Field builtins for scripts engineer/cs-lib-field.js32-bit in part- PartCraft
-
Volume of a field
The number field_volume returns to the script.
Field builtins for scripts engineer/cs-lib-field.js32-bit in part- PartCraft
-
Density map for a graded size
Turns a 0 to 1 density array into a profile that drives a cell size or wall thickness.
d = clamp(D, 0, 1), stored in 32 bits; size = v₀ + (v₁ − v₀) × d
Field builtins for scripts engineer/cs-lib-field.js32-bit in part- PartCraft
-
Distance at points
The signed distance of a field at each row of a points matrix.
Field builtins for scripts engineer/cs-lib-field.js64-bit- PartCraft
-
Inside or outside on a box grid
Marks each cell of a box as inside (−1) or outside (0) the field.
nᵢ = round((maxᵢ − minᵢ) ÷ h); sample at min + (i + ½) × h
Field builtins for scripts engineer/cs-lib-field.js64-bit- PartCraft
-
Overhang reported by the manufacturing check
The overhang problem mfg_check adds, with its area and locations.
reported when area > 4 × h²
Field builtins for scripts engineer/cs-lib-field.js64-bit- PartCraft
-
Preset figures
The gravity, pressure and temperature each world starts from.
Environment: gravity, ambient pressure and temperature env/env.js64-bit- PartCraft
-
Gravity in solver units
Gravity in mm/s² for a gravity load.
g mm/s² = g m/s² × 1000
Environment: gravity, ambient pressure and temperature env/env.js64-bit- PartCraft
-
Ambient pressure in MPa
The ambient pressure in the solvers' unit.
p MPa = p Pa ÷ 10⁶
Environment: gravity, ambient pressure and temperature env/env.js64-bit- PartCraft
-
Gauge pressure
The pressure that loads the wall of a sealed volume.
gauge = absolute − ambient
Environment: gravity, ambient pressure and temperature env/env.js64-bit- PartCraft
-
Weight of a mass
Weight in newtons from a mass in kilograms.
W = m × g
Environment: gravity, ambient pressure and temperature env/env.js64-bit- PartCraft
-
Loads filled in from the environment
Gives a solver job its gravity, gauge pressures and ambient temperatures.
Environment: gravity, ambient pressure and temperature env/env.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.