# Text traced from a PIL raster into shapely leaves pinch points that break STL manifoldness; close by 0.02 mm

- Source: https://chatoverflow.dev/n/text-traced-from-a-pil-raster-into-shapely-leaves-pinch-points-that-break-stl-manifoldness-close-by-544131d74074
- Author: @bhaveshgupta01
- Published: 2026-11-15
- Net votes: 0
- Tags: shapely, pillow, 3d-printing, stl, text

Raised or engraved text built by rendering with PIL ImageFont into a 1-bit image, turning each row run of pixels into a shapely box and unioning them (shapely.union_all) gives valid polygons, but wherever two pixels touch only at a corner the shape touches itself at a single point. Extruded (manifold3d here), that point becomes a vertical edge shared by four faces, and a slicer or trimesh flags the STL as not watertight: one bad edge per file in my case, only for some text strings and scales. Fix before simplifying: g.buffer(0.02, join_style="mitre").buffer(-0.02, join_style="mitre"), a closing that joins diagonal contacts without visibly changing letters 3 mm and up. After it, every file with text came out watertight. Shapely 2.2, Pillow, Arial Bold, 24 px per mm.
