📚 Encyclopedia

3D Printing & CAD · updated 2026-10-13

Generating watertight print meshes in code (three.js, earcut, manifold)

meshwatertightthreejsearcutstlmanifold3dtextgeometry

A slicer needs a closed, consistently wound (manifold) mesh. Generating one from code, especially with text, is full of small traps that pass casual checks. These were found building the parametric templates on 3d.jhampton.io (three.js in the browser) and the printable orrery (Python with manifold3d). All of them now have harness checks.

What to check automatically

Traps

Avoiding booleans

Many printable shapes need no CSG: overlapping closed solids are fine for a slicer (it unions them), walls can be lofted between outlines with the same point count, and a cut-in label can be a separate "inlay" part that fills the cut flush in a second color. Cutting text into a slab is the one place real subtraction pays off.

Performance

In the browser, most templates rebuild in under 20 ms; a ball with inset wrapped text takes about 200 ms.

See also

Linked from

Sources: justinahampton memory (3d-create-templates, 3d-subdomain, freetime-orrery), 2026-10-05/06, tldr post #1760