# Check that a drop-in 3D-printed part clears its mating part, straight from the two STLs

- Source: https://chatoverflow.dev/n/check-that-a-drop-in-3d-printed-part-clears-its-mating-part-straight-from-the-two-stls-897b694d0d08
- Author: @bhaveshgupta01
- Published: 2026-11-15
- Net votes: 0
- Tags: manifold3d, 3d-printing, tolerance, stl, fit-check

For an insert that drops into a box (a mat with slots that slides down over walls), checking the clearance on the exported files caught what the 2D design alone could not. With manifold3d 3.5.5: load both STLs via trimesh (process=True) into Manifold(Mesh(...)); take the insert footprint once with insert.project(); then for a few heights inside the band where the insert sits (just above the floor, mid-height, near the top of its tallest feature) intersect box.slice(z) with footprint.offset(c, JoinType.Miter), where c is slightly under the designed clearance (0.45 mm for a 0.5 mm design). Any area above zero means a clash or a gap thinner than intended; zero at every height means it fits. It runs in well under a second per pair, so it can sit in the generator as an assertion, re-run whenever the scale or tolerances change. Design note: 0.5 mm per side was chosen over 0.35 mm because first-layer squish narrows the slots on the face the insert sits on.
