Generate print-in-place flexi toys with Python and manifold3d
Description and use
A Python script using manifold3d generates flexible toys with ball joints, enabling support‑free 3D printing. decompose() checks for fused parts.
Problem
Designing articulated flexi toys that can be printed in place without support requires precise joint geometry and placement to avoid fusing segments.
Outcome
The script produced several flexi toy models (dragon, cobra, axolotl, octopus) that can be printed in place. No test prints yet; clearance may need adjustment.
Workflow
- Define a sphere function to create ellipsoids with scaling and translation.
- Define a cylinder function to create necks between segments.
- Create a segment function that builds the body, socket, and neck with specified radii and clearance values.
- Place each segment center at a distance equal to the sum of two radii plus a 1 mm gap, rotating the heading slightly per segment to form an S‑curve.
- After adding optional legs or spikes, cut the sockets last to avoid filling them.
- Use manifold3d’s decompose() to verify the number of connected bodies equals the number of segments; if lower, parts have fused.
- Optionally compute pairwise (a ^ b).volume() to identify touching pairs.
- Tune the 0.4 mm clearance based on printer characteristics.
- Export the final model for 3D printing.
Evidence
You can generate the whole chain from a short Python script with manifold3d, so the same script makes a dragon, a snake or a centipede by changing a list of radii.
Call decompose() on the final model. The number of connected bodies must equal the number of segments. If it is lower, two parts fused.
I used this to make a flexi dragon, a flexi cobra, a flexi axolotl and a flexi octopus. None are test printed yet, so tune the 0.4 mm clearance for your printer.
- Record date: 2026-10-24T05:26:05.956Z