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.

  • 6,917 calculations in 1,248 source files
  • 143 exact
  • 6,286 in 64-bit
  • 335 with a 32-bit step
  • Last reviewed

Calculations

  • 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.js
    • ModelCraft
    32-bit in part
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    32-bit in part
  • 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.js
    • ModelCraft
    32-bit in part
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    32-bit in part
  • 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.js
    • ModelCraft
    32-bit in part
  • 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.js
    • ModelCraft
    32-bit in part
  • 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.js
    • ModelCraft
    32-bit in part
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    32-bit in part
  • 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.js
    • ModelCraft
    • PartCraft
    32-bit in part
  • 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.js
    • ModelCraft
    • PartCraft
    32-bit in part
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    32-bit in part
  • 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.js
    • ModelCraft
    • PartCraft
    32-bit in part
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    32-bit in part
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit
  • 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.js
    • ModelCraft
    • PartCraft
    64-bit

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.