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
-
Cone
A cone with a 32-sided base of radius R and its apex at height S.
Beginner shapes, align and drop to ground beginner.js64-bit- ModelCraft
-
Sphere
A sphere of radius R resting on z = 0, made of 12 rings of 24 faces.
θ = π·i ÷ 12; φ = 2π·j ÷ 24; p = [R·sin θ·cos φ, R·sin θ·sin φ, R − R·cos θ]
Beginner shapes, align and drop to ground beginner.js64-bit- ModelCraft
-
Roof
A triangular prism: a triangle across x pulled along y from −R to +R.
Beginner shapes, align and drop to ground beginner.js64-bit- ModelCraft
-
Align
Moves each selected placement so the minimum, middle or maximum of its box on one axis meets that of the whole selection.
target = lo, hi or (lo + hi) ÷ 2; move = target − own value; m[12 + axis] += move
Beginner shapes, align and drop to ground beginner.js64-bit- ModelCraft
-
Drop to ground
Moves each selected placement up or down so the bottom of its box is at z = 0.
m[14] += −box.min.z
Beginner shapes, align and drop to ground beginner.js64-bit- ModelCraft
-
Rounding to 0.1 mm
The rounding applied to every stored mesh coordinate, plan polygon point and item size.
r1(v) = round(v × 10) ÷ 10
Trees, people and cars from numbers entourage.js64-bit- ModelCraft
-
Mesh point
Adds one point to a part's mesh.
Trees, people and cars from numbers entourage.js64-bit- ModelCraft
-
Ring loft
Trunks, pots, limbs and conifer tiers: rings of points round an axis joined into a capped solid.
a = 2π·i ÷ seg; p = [cx + rx·cos a, cy + ry·sin a, z]
Trees, people and cars from numbers entourage.js64-bit- ModelCraft
-
Crown and head blobs
Tree crowns, shrubs, rocks and heads: an icosphere scaled to an ellipsoid with a seeded bump.
t = (1 + √5) ÷ 2; unit point p; k = 1 + bump × (2·rand − 1); point = c + p × [rx, ry, rz] × k
Trees, people and cars from numbers entourage.js64-bit- ModelCraft
-
Wheel
A car wheel: a 14-sided cylinder along y.
a = 2π·i ÷ seg − π ÷ 2; p = [x + r·cos a, y, z + r·sin a]
Trees, people and cars from numbers entourage.js64-bit- ModelCraft
-
Canopy plan symbol
The plan outline of a tree: a 14-point irregular ring, a trunk circle and a cross.
a = 2π·i ÷ 14; k = r × (0.86 + 0.18·rand); p = [k·cos a, k·sin a]
Trees, people and cars from numbers entourage.js64-bit- ModelCraft
-
Library item sizes
The width, depth and height written into the library item.
Trees, people and cars from numbers entourage.js64-bit- ModelCraft
-
Signed polygon area
The signed area of a plan polygon.
area = ½ Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)
Room outline and furniture placement furnish-mc.js64-bit- ModelCraft
-
Room from a floor face
The outline, holes, height and area of a room from a level face that looks up.
floor if n_z > 0.999; plan = model point × 1000; area (m²) = (outer − Σ holes) ÷ 10⁶
Room outline and furniture placement furnish-mc.js64-bit- ModelCraft
-
Doors and windows near the room
Which starter doors and windows belong to the room, with their middle, width and sill height in millimeters.
middle = box center × 1000; width = max(Δx, Δy) × 1000; near if distance to outline ≤ 400
Room outline and furniture placement furnish-mc.js64-bit- ModelCraft
-
Placement matrix for a piece
The matrix that lays a furniture piece on the planner's footprint.
x axis = (fp₁ − fp₀) ÷ 1000 ÷ W; y axis = (fp₃ − fp₀) ÷ 1000 ÷ D; origin = fp₀ ÷ 1000 − x axis·min.x − y axis·min.y; z = floor − min.z
Room outline and furniture placement furnish-mc.js64-bit- ModelCraft
-
Reading position and turn
The x, y, z and turn a control program reads for a placement.
x, y, z = m[12], m[13], m[14]; rotZ = atan2(m[1], m[0]) × 180 ÷ π
Control program host: placement position and turn plc-scene-mc.js64-bit- ModelCraft
-
Writing position and turn
Applies the values a control program set to the placement's matrix when the run is kept.
sx = √(m₀² + m₁²); sy = √(m₄² + m₅²); a = rotZ × π ÷ 180; m₀ = sx·cos a, m₁ = sx·sin a, m₄ = −sy·sin a, m₅ = sy·cos a
Control program host: placement position and turn plc-scene-mc.js64-bit- ModelCraft
-
Triangle normals, areas and boxes
The unit normal, area and bounding box of every triangle, and the size of the whole mesh.
n = (b − a) × (c − a); area = |n| ÷ 2; unit normal = n ÷ |n|
Rays and distances on a printer mesh print-geom.js64-bit- ModelCraft
- PartCraft
-
Nearest face along a ray
The distance to the first triangle a ray meets between two limits, and whether it meets it from behind.
det = e₁·(d × e₂); u = (s·(d × e₂)) ÷ det; v = (d·(s × e₁)) ÷ det; t = (e₂·(s × e₁)) ÷ det
Rays and distances on a printer mesh print-geom.js64-bit- ModelCraft
- PartCraft
-
Ray and box
Whether a ray passes through a box within the current distance limits.
t_near = (min − o) × (1 ÷ d); t_far = (max − o) × (1 ÷ d), per axis
Rays and distances on a printer mesh print-geom.js64-bit- ModelCraft
- PartCraft
-
Point to triangle distance
The squared distance from a point to the closest point of one triangle.
closest point q by the corner, edge and face regions; d² = |p − q|²
Rays and distances on a printer mesh print-geom.js64-bit- ModelCraft
- PartCraft
-
Distance to the nearest face
The distance from a point to the nearest triangle within a search radius.
d = √(min over triangles of d²), limited to r
Rays and distances on a printer mesh print-geom.js64-bit- ModelCraft
- PartCraft
-
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
-
Overhanging faces and their area
Which triangles need support, and their total area.
overhang if n_z < −cos((90 − angle)·π ÷ 180) and not on the bed; area = Σ triangle areas
Supports preview and material estimate print-supports.js64-bit- ModelCraft
-
Support points under the overhangs
Grid points in plan that fall inside an overhanging triangle, with their height on it.
s = max(spacing, √(overhang area ÷ maxPoints)); (x, y) = ((i + ½)·s, (j + ½)·s); z = λ₁z_a + λ₂z_b + λ₃z_c
Supports preview and material estimate print-supports.js64-bit- ModelCraft
-
Where a support lands
The height below each support point where a straight line down meets the model, or the bed.
bottom = z − eps − distance down to the first face, else bed z
Supports preview and material estimate print-supports.js64-bit- ModelCraft
-
Column volume
The material one column adds to the estimate.
columns: V = s² × density × h; tree style: V = π × tip² × h; drawn radius = s × √(density ÷ π)
Supports preview and material estimate print-supports.js64-bit- ModelCraft
-
Tree supports
Joins nearby support points to one trunk and adds the branches' and trunk's volume.
joint z = min(zᵢ − horizontal distanceᵢ ÷ tan(branch)); trunk radius = tip × √k; V = Σ π·tip²·lengthᵢ + π·r²·(joint z − base z)
Supports preview and material estimate print-supports.js64-bit- 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
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.