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
-
Sampling a cut section
For a grid of points over the cut: inside the model or not, and the distance to the outline.
step = max(largest extent ÷ samples, 0.2); inside = odd number of outline crossings to the left; distance = √(min squared distance to an outline segment)
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Touching area of a joint
The area where two pieces meet on a cut.
area += samples in the region × step²
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Room a connector needs
The least distance from a connector's axis to any outside surface, and how deep it goes each side.
peg: d ÷ 2 + c + w; key: (W ÷ 2)·√2 + c + w; dovetail: w₁ ÷ 2 + c + w with w₁ = W + 2H·tan(angle); dowel, magnet: d ÷ 2 + c + w
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Round hole with its flats on the radius
Sizes a faceted hole so its flat sides, not its corners, are at the asked radius.
corner radius = r ÷ cos(π ÷ segments)
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Connector and hole solids
The peg, key, dovetail, dowel pin or magnet pocket and the matching hole, in the joint's own frame.
hole radius = r + c; hole depth = L + c; chamfer = min(0.5, r ÷ 3); dovetail half width at z: w₀ + (w₁ − w₀)·z ÷ H + growth
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Does a connector fit here
Checks along a connector's depth that it stays inside the model with a wall all round and clear of the other cuts.
at steps of 0.75 mm along the depth: inside, nearest outside surface ≥ lateral, distance to every other cut ≥ lateral + deepest hole
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Spreading connectors along a joint
Picks up to k connector spots spread along the long axis of the touching area.
θ = ½·atan2(2·Σuv, Σu² − Σv²) about the mean; samples sorted by their position along that axis and cut into k slices
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Length of a dovetail
How far a dovetail runs each way from its spot, and whether each end is open.
open end: (steps + ½) × step + wall + 1; stopped end: max(0, steps × step − lateral)
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Engraved joint number
The joint's number as a solid: each stroke of the stroke font widened to a rectangle, joined and extruded.
stroke width = max(0.6, 0.14 × h); rectangle = segment grown by half the width on all sides
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Corners back onto slanting cut planes
Moves each corner that lies within 2e-4 mm of a slanting cut plane, or of a connector or number depth parallel to it, exactly onto that plane.
s = n·p − d; if 0 < |s| < 2 × 10⁻⁴: p ← p − n·s
Splitting a model into printable pieces print-split.js32-bit in part- ModelCraft
- PartCraft
-
Building and measuring each piece
Adds the male connectors, cuts the holes and numbers, and returns each piece with its size, volume and print check.
piece = (cut part ∪ male parts) − holes − numbers; size = box of its corners; volume from the library
Splitting a model into printable pieces print-split.js32-bit in part- ModelCraft
- PartCraft
-
Laying a piece on the bed
Turns a piece in 90° steps so it fits the bed and moves it to stand on z = 0 at x, y ≥ 0.
new[k] = ±old[q(k)]; then new[k] −= min over the piece
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Piece list on the assembly sheet
One line per piece with its size and volume, then the joints and the pins.
size shown = round(mm × 10) ÷ 10; volume shown = round(mm³ ÷ 1000 × 10) ÷ 10 cm³; pin length = dowel length − clearance
Splitting a model into printable pieces print-split.js32-bit in part- ModelCraft
- PartCraft
-
Normal of a slanting cut
The normal of a cut across one axis, turned by an angle about another axis.
n = axis·cos r + (about × axis)·sin r, r = degrees × π ÷ 180
Splitting a model into printable pieces print-split-ui.js64-bit- ModelCraft
- PartCraft
-
Cut places typed by the person
Turns the typed distances from the low end of the model into cut planes.
point = middle of the box, with axis coordinate lo + v; d = n·point
Splitting a model into printable pieces print-split-ui.js64-bit- ModelCraft
- PartCraft
-
Connector spot picked by hand
Where the ray under a click crosses the cut plane between two pieces.
t = (d − n·o) ÷ (n·dir); p = o + dir × t
Splitting a model into printable pieces print-split-ui.js64-bit- ModelCraft
- PartCraft
-
Welding corners
Joins corners that lie within the tolerance of each other and drops triangles that collapse.
join if |Δx| ≤ tol and |Δy| ≤ tol and |Δz| ≤ tol; drop if two corners are the same or |n|² ≤ (tol² × 0.01)²
Print check: weld, volume, area and intersections print3d.js64-bit- ModelCraft
- PartCraft
-
Volume, area, overhang and bed contact
Each shell's volume, the total surface area, the area that needs support and the area lying on the bed.
area = Σ |n| ÷ 2; V_shell = Σ a·(b × c) ÷ 6; overhang if n_z ÷ |n| < −cos((90 − angle)·π ÷ 180)
Print check: weld, volume, area and intersections print3d.js64-bit- ModelCraft
- PartCraft
-
A shell inside another shell
Decides whether an inside-out shell is a hollow inside another shell, which is correct, or a real fault.
ray from one corner along [0.000123, 0.000457, 1]; inside if it crosses the other shells an odd number of times
Print check: weld, volume, area and intersections print3d.js64-bit- ModelCraft
- PartCraft
-
Ray and triangle
The distance along a ray to a triangle, or −1 when it misses.
det = e₁·(d × e₂); u = s·(d × e₂) ÷ det; v = d·(s × e₁) ÷ det; t = e₂·(s × e₁) ÷ det
Print check: weld, volume, area and intersections print3d.js64-bit- ModelCraft
- PartCraft
-
Finding triangle pairs to test
Finds pairs of triangles whose boxes overlap and counts those that cross, within one shell and between shells.
eps = diagonal × 10⁻⁹; boxes grown by eps; pair tested with tolerance 10 × eps
Print check: weld, volume, area and intersections print3d.js64-bit- ModelCraft
- PartCraft
-
Do two triangles cross
Whether two triangles pass through each other, more than touching.
signed distances of each triangle's corners to the other's plane, set to 0 within eps; overlap of the two intervals on the planes' common line must exceed eps
Print check: weld, volume, area and intersections print3d.js64-bit- ModelCraft
- PartCraft
-
Triangles in the same plane
Whether two triangles in one plane overlap.
2D orientation tests on the projection that drops the normal's largest axis; crossing edges, or one centroid inside the other
Print check: weld, volume, area and intersections print3d.js64-bit- ModelCraft
- PartCraft
-
Total volume and bed fit
The volume reported for a mesh without problems, and the warnings for a tiny model or one larger than the bed.
V = Σ shell volumes (hollows are negative); fits if sizeₖ ≤ bedₖ + 10⁻⁹, as given or with x and y swapped
Print check: weld, volume, area and intersections print3d.js64-bit- ModelCraft
- PartCraft
-
Binary STL
Writes each triangle's unit normal and three corners.
normal = n ÷ |n| from the winding; every number written with setFloat32
STL and 3MF files for the printer print3d.js32-bit in part- ModelCraft
- PartCraft
-
A coordinate as 3MF text
Formats one coordinate for the 3MF file.
0 if |v| < 10⁻¹²; else v rounded to 10 significant digits
STL and 3MF files for the printer print3d.js64-bit- ModelCraft
- PartCraft
-
3MF vertex list
Writes every corner of the mesh as a vertex element.
STL and 3MF files for the printer print3d.js64-bit- ModelCraft
- PartCraft
-
Knot span
Finds the knot interval that holds a parameter.
3DM curves and surfaces: points on them io/3dm/geom.js64-bit- ModelCraft
- PartCraft
-
de Boor's algorithm
A point of a B-spline from its control points and knots.
a = (t − k₀) ÷ (k₁ − k₀); d_j = (1 − a) d_(j−1) + a d_j, repeated degree times
3DM curves and surfaces: points on them io/3dm/geom.js64-bit- ModelCraft
- PartCraft
-
Rational point
Divides a homogeneous point by its weight.
(x, y, z) = (X, Y, Z) ÷ w
3DM curves and surfaces: points on them io/3dm/geom.js64-bit- ModelCraft
- PartCraft
-
Point on a NURBS surface
A surface point from its control net.
de Boor along v for each active row, then along u, then the division by the weight
3DM curves and surfaces: points on them io/3dm/geom.js64-bit- ModelCraft
- PartCraft
-
Point on a curve
A point on a line, arc, polyline, NURBS curve or chain of curves at a parameter.
arc: a = angle mapped from the parameter; p = o + r cos a × x + r sin a × y
3DM curves and surfaces: points on them io/3dm/geom.js64-bit- ModelCraft
- PartCraft
-
A curve as a polyline
Cuts a curve into chords that stay within a tolerance of it, keeping every knot and corner.
a piece is halved while its middle or quarter points lie farther than tol from the chord, at most 10 times
3DM curves and surfaces: points on them io/3dm/geom.js64-bit- ModelCraft
- PartCraft
-
Rotation about an axis
Turns a point about a line by an angle, for surfaces of revolution.
p′ = o + v cos a + (z × v) sin a + z (z · v)(1 − cos a)
3DM curves and surfaces: points on them io/3dm/geom.js64-bit- ModelCraft
- PartCraft
-
Point on a surface
A point on a plane, NURBS surface, surface of revolution or sum surface.
plane: o + a x + b y; revolution: the profile point turned about the axis; sum: p(u) + q(v) + base
3DM curves and surfaces: points on them io/3dm/geom.js64-bit- ModelCraft
- PartCraft
-
Surface normal
The unit normal of a surface at a point.
∂u ≈ S(u + h, v) − S(u − h, v); ∂v likewise; n = ∂u × ∂v, made unit; h = 1e-5 × parameter range
3DM curves and surfaces: points on them io/3dm/geom.js64-bit- ModelCraft
- PartCraft
-
A saved mesh as triangles
Copies a mesh record's points and splits its quads into triangles.
3DM surfaces into triangles io/3dm/tess.js64-bit- ModelCraft
- PartCraft
-
Joining points that coincide
Makes one vertex of points that sit at the same place, so the faces of a solid close up.
q = max(diagonal × 1e-9, 1e-12); same vertex when round(x ÷ q), round(y ÷ q) and round(z ÷ q) are equal
3DM surfaces into triangles io/3dm/tess.js64-bit- ModelCraft
- PartCraft
-
Sampling a shared edge
Samples an edge once on its 3D curve, for both faces that share it.
fraction s = (t − t₀) ÷ (t₁ − t₀) along the edge's own direction
3DM surfaces into triangles io/3dm/tess.js64-bit- ModelCraft
- PartCraft
-
Scaling the parameter plane
Scales u and v so a step in each is about as long on the surface, before triangulating.
L_u, L_v = lengths of the two mid-lines measured with 8 chords; k_u = L_u ÷ Δu; k_v = L_v ÷ Δv
3DM surfaces into triangles io/3dm/tess.js64-bit- ModelCraft
- PartCraft
-
Halving an interior edge
Decides whether a triangle edge needs a new point at its middle, and adds it.
halve when the edge is longer than 2 tol and (|S(mid) − chord middle| > tol or n_a · n_c < cos 20°)
3DM surfaces into triangles io/3dm/tess.js64-bit- ModelCraft
- PartCraft
-
Grid step from the surface's bend
How far apart interior points are placed, from how much the surface bends.
k = angle between neighboring normals ÷ their distance (75th percentile of a 9 × 9 grid); h = min(√(8 tol ÷ k), 0.349 ÷ k), not below max(L) ÷ 400 or √(L_u L_v ÷ 40000)
3DM surfaces into triangles io/3dm/tess.js64-bit- ModelCraft
- PartCraft
-
Grid points inside a face
Picks the grid points that lie inside the face's loops and not too near a side.
inside by counting crossings of the row (even-odd); kept when at least half a grid step from every side
3DM surfaces into triangles io/3dm/tess.js64-bit- ModelCraft
- PartCraft
-
Extrusions
Walls along the path from each profile, and caps from the closed profiles with their holes.
frame: T = path direction, X = up × T, Y = T × X; point = origin + x X + y Y; profile closed when its ends are within max(tol, 1e-9)
3DM surfaces into triangles io/3dm/tess.js64-bit- ModelCraft
- PartCraft
-
Tessellation tolerance
The distance triangles may stand off a surface, per object.
base = given tolerance, else the file's, else 0.01; tol = max(base, 0.0015 × diagonal of the object's rough box)
3DM surfaces into triangles io/3dm/scene.js64-bit- ModelCraft
- PartCraft
-
Rough box of an object
A box round an object from its vertices, curve break points and control points, used only to set the tolerance.
3DM surfaces into triangles io/3dm/scene.js64-bit- ModelCraft
- PartCraft
-
Rotation matrix
The matrix that turns geometry by an angle about an axis through a point.
R = c·I + s·[axis]ₓ + (1 − c)·axis·axisᵀ, c = cos(angle·π ÷ 180), s = sin(angle·π ÷ 180); t = p − R·p
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Scale matrix
The matrix that scales geometry by a factor about a center.
p′ = f·p + c·(1 − f)
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Applying a matrix to geometry
Moves a point, a curve, a surface, a mesh or a list of them by a 4 × 4 matrix.
Node graph functions nodes/library.js64-bit- ModelCraft
- PartCraft
-
Divide, power and remainder
The Divide, Power, Smaller, Larger and Remainder nodes.
a ÷ b; aᵇ; remainder = a − b·floor(a ÷ b)
Node graph functions nodes/library.js64-bit- 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.