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
-
Mass properties reported to the assistant
Volume, area, center, mass and inertia of the built solid.
mass = V × ρ ÷ 1000; inertia = tensor × ρ ÷ 1000
Part and assembly mass in the bill of materials, measure panel and assistant agents.js32-bit in part- PartCraft
-
Mass properties in the measure panel
Where the measure panel gets a body's mass properties, exact or from the mesh.
Part and assembly mass in the bill of materials, measure panel and assistant measure-ui.js32-bit in part- PartCraft
-
Number format in the measure panel
Rounds a measure value to a number of decimals for the panel.
toFixed(dp); |v| < 1e-12 shown as 0
Part and assembly mass in the bill of materials, measure panel and assistant measure-ui.js64-bit- PartCraft
-
Outline points of a PolyLine or Polygon
The points of a polyline, polygon, cloud or area markup read from an annotation.
Annotations and scales read from a PDF pdf-read.js32-bit in part- MarkupCraft
-
Stroke points of an Ink annotation
The points of pen and highlighter strokes, and of count rings, read from an annotation.
Annotations and scales read from a PDF pdf-read.js32-bit in part- MarkupCraft
-
End points of a Line annotation
The two end points of a line, arrow or length measurement read from an annotation.
Annotations and scales read from a PDF pdf-read.js64-bit- MarkupCraft
-
Box of a Square or Circle annotation
The box of a rectangle, ellipse or cloud rectangle markup from the annotation's /Rect.
box = rect inset by RD and by half the border width on each side
Annotations and scales read from a PDF pdf-read.js64-bit- MarkupCraft
-
Count mark from its ring
The position of each count mark, from the ring written for it in the ink list.
center = mean of the ring's points (the closing point dropped)
Annotations and scales read from a PDF pdf-read.js64-bit- MarkupCraft
-
Moved by another program
Decides whether a markup's private JSON still matches the annotation, or another program moved or resized it since.
|ar − rect| > 0.75 pt on any of the four numbers → use the annotation's own geometry
Annotations and scales read from a PDF pdf-read.js64-bit- MarkupCraft
-
Scale from another program's /Measure
A sheet calibration from the measurement dictionary another PDF program wrote.
mmPerPt = C × mm per unit (ft 304.8, in 25.4, m 1000, cm 10, mm 1)
Annotations and scales read from a PDF pdf-read.js64-bit- MarkupCraft
-
Which scale a sheet opens with
Picks the calibration of a page: MarkupCraft's own saved copy, else the page's measure viewport.
Annotations and scales read from a PDF pdf-read.js64-bit- MarkupCraft
-
Text size from an appearance stream
The size of the first visible text that another program's text box draws.
size = |Tf size × text matrix scale × cm scale|, rounded to 0.01
Annotations and scales read from a PDF freetext.js64-bit- MarkupCraft
-
Text size from a style string
Reads 12pt, 16px or 1.2em from a text box's style as points.
px × 0.75; em × 12; pt as written
Annotations and scales read from a PDF freetext.js64-bit- MarkupCraft
-
Inward offset of every corner
Moves each corner inward so that every face around it moves by the wall thickness, and rejects the result where an offset would fold.
q = p − wall × m, with n·m = 1 for every face direction n at the corner
Hollowing a body to a wall thickness print-hollow.js64-bit- ModelCraft
-
Corner move from the face directions
The vector m with n·m = 1 for each face direction at a corner.
one direction: m = n; two: m = (n₁ + n₂) ÷ (1 + n₁·n₂); more: (NᵀN) m = Nᵀ1
Hollowing a body to a wall thickness print-hollow.js64-bit- ModelCraft
-
Grid step of the distance field
Chooses the grid step and size for the distance field.
h = min(wall ÷ 2.5, largest size ÷ 24); h ← 1.15·h while Π(⌈sizeₖ ÷ h⌉ + 5) > maxCells; band B = wall + 2h
Hollowing a body to a wall thickness print-hollow.js64-bit- ModelCraft
-
Signed distance field
The distance from every grid point to the outside surface, negative where the point is deeper inside than the wall.
d² = min over triangles of |x − closest point|², capped at B²; φ = ±√d² + wall (− inside)
Hollowing a body to a wall thickness print-hollow.js32-bit in part- ModelCraft
-
Cavity surface point on a grid edge
Where the cavity surface crosses a grid edge between a point in the hollow and a point in the material.
s = φₐ ÷ (φₐ − φ_b), clamped to [0.001, 0.999]; p = pₐ + (p_b − pₐ) × s
Hollowing a body to a wall thickness print-hollow.js32-bit in part- ModelCraft
-
Signed volume of a mesh
The volume enclosed by a triangle mesh, used for the body and for the cavity.
V = Σ a·(b × c) ÷ 6
Hollowing a body to a wall thickness print-hollow.js64-bit- ModelCraft
-
Choosing the method and reporting the result
Runs the offset, falls back to the field, and returns the hollow body, the cavity and their volumes.
cavity volume = −V(cavity mesh)
Hollowing a body to a wall thickness print-hollow.js64-bit- ModelCraft
-
Drain hole cylinder
A 24-sided cylinder along the inward normal of a picked face, long enough to reach the hollow.
depth = first face behind the pick; top = p + n·extra; bottom = p − n·(depth + extra); ring = c + r·(cos θ·u + sin θ·w)
Hollowing a body to a wall thickness print-hollow.js64-bit- ModelCraft
-
Triangles of a placement
Every triangle of a placement and what is nested inside it, in the open context's coordinates.
p′ = M · p, M = product of the nested placement matrices
Print tool results back in the model print-solid.js64-bit- ModelCraft
-
Welding triangles into a mesh
Joins corners that fall in the same cell of a 1e-7 m grid and marks edges sharper than a given angle.
key = round(x ÷ weld), round(y ÷ weld), round(z ÷ weld); sharp if n₁·n₂ < cos(sharpDeg)
Print tool results back in the model print-solid.js64-bit- ModelCraft
-
Triangles into the boolean library
Hands a part's corners to manifold-3d, measured from a nearby origin.
q = p − o; corners welded where round(q × 10⁷) agree; stored as 32-bit
Print tool results back in the model print-solid.js32-bit in part- ModelCraft
-
Union and subtraction
The triangles of the kept parts joined, less the cut parts.
o = middle of the box of all parts; result corner = o + 32-bit corner from the library
Print tool results back in the model print-solid.js32-bit in part- ModelCraft
-
Volume of a triangle set
The volume the triangles enclose, used to check that a solid kept the result's volume.
V = Σ a·(b × c) ÷ 6
Print tool results back in the model print-solid.js64-bit- ModelCraft
-
Result as a solid on a 1 µm grid
Turns the result's triangles into a solid group of flat faces, or reports why it stays a mesh.
g(x) = round(x × 10⁶) ÷ 10⁶; keep if closed and |V_solid − V| ≤ |V| × 10⁻⁴ + 10⁻¹⁵
Print tool results back in the model print-solid.js64-bit- ModelCraft
-
Thickness behind a triangle
The distance from a triangle's middle, straight in, to the far side of the wall.
origin = centroid − n·eps; thickness = distance to the first face met from behind + eps
Wall-thickness check print-walls.js32-bit in part- ModelCraft
-
Values for unmeasured triangles
On a decimated check, gives each unmeasured triangle the value of the nearest measured one across shared edges.
Wall-thickness check print-walls.js32-bit in part- ModelCraft
-
Thinnest wall and thin area
The smallest thickness found and the total area of triangles under the limit.
thinnest = min(values); thin area = Σ area of triangles with value < min
Wall-thickness check print-walls.js32-bit in part- ModelCraft
-
Thin regions
Thin triangles joined across shared edges into regions, each with its area, its thinnest value and where that is.
region area = Σ triangle areas; at = centroid of the thinnest triangle
Wall-thickness check print-walls.js32-bit in part- ModelCraft
-
Fewest cells that fit the bed
How many equal cells along x, y and z make every piece fit the printer bed, allowing a piece to lie on its side.
start: nₖ = ⌈sizeₖ ÷ largest bed side − 10⁻⁹⌉; cellₖ = sizeₖ ÷ nₖ (+ extra on a cut axis); fits if cellₖ ≤ bed_p(k) + 10⁻⁹
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Cut planes of the grid
The planes that cut the model's box into the chosen number of cells.
d = lo + (hi − lo) × i ÷ n
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Planes and triangles about the model's middle
Normalizes the given planes and moves planes and triangles to coordinates measured from the middle of the model's box.
n̂ = n ÷ |n|; d = d ÷ |n|; d_local = d − n̂·org; p_local = p − org
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
Model into the boolean library
Hands the model's corners to manifold-3d, measured from the middle of its box.
q = p − org; corners welded where round(q × 10⁵) agree; stored as 32-bit
Splitting a model into printable pieces print-split.js32-bit in part- ModelCraft
- PartCraft
-
Pieces back from the boolean library
Reads a piece's corners from manifold-3d and returns them to world coordinates.
world = org + 32-bit local corner
Splitting a model into printable pieces print-split.js32-bit in part- ModelCraft
- PartCraft
-
Cutting by each plane
Splits every cell by the next plane and keeps the parts that have volume.
Splitting a model into printable pieces print-split.js32-bit in part- ModelCraft
- PartCraft
-
Outline of a cut through the model
The line segments where a plane crosses the model's triangles, in the plane's own two axes.
sᵢ = n·pᵢ − d; k = sᵢ ÷ (sᵢ − sⱼ); point = pᵢ + (pⱼ − pᵢ) × k
Splitting a model into printable pieces print-split.js64-bit- ModelCraft
- PartCraft
-
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
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.