Designing a printable replacement part from photos and calipers
3d-printingparametricblendercadquerypress-fitfit-testphotogrammetrypetg
Making a printable replacement for a broken physical part (a mower wheel, a device case) is mostly a measurement problem, not a modeling problem. The approach that worked: model the part parametrically in a script from a handful of measured dimensions, print a cheap fit coupon for the one dimension that must be exact, and only then commit to the long print.
Scan or model?
Photogrammetry needs a dense orbit of 60 to 90 overlapping photos; a dozen reference shots with a tape and calipers in frame is not a scan. For anything that is essentially a solid of revolution or a box (wheels, hubs, enclosures), direct parametric modeling from measurements is better anyway: exact, editable, and small. (Meshroom 2025.1 has a CUDA-12 Linux build that works with an RTX 4070 if a real scan is ever needed.)
Measure, and ask about every unknown
- List every dimension the model needs and get each one measured. Do not assume: on the 8 in mower wheel, the tread width was assumed 44.5 mm and was really 50.8 mm (exactly 2.000 in), and the bore depth was never asked. See Working with Justin as an AI agent (ask first, confirm the target, precise verbs, artifacts over essays).
- Cross-check numbers for consistency (a 35.5 vs 36.0 mm bushing length came from double-counting a lip).
- Photo-estimated dimensions are worth about plus or minus 2 mm. Put them as named parameters at the top of the script and say plainly that they await calipers (the Pi console case did this for width, length, hole inset and board position).
Model in a script
- Blender headless:
blender --background --python build.py -- <args>. Build solids with bmesh and explicit coordinates. A loop ofbpy.opsprimitive + rotate +transform_applyproduced unrotated boxes and 2,733 non-manifold edges; the bmesh version had zero. Export withbpy.ops.wm.stl_export(importbpy.ops.wm.stl_import). See Blender Python scripting, safety audit and gotchas. - CadQuery is a good alternative for boxy mechanical parts and exports STEP too:
uv run --with cadquery python case.py. - Check every output mesh for watertightness and zero non-manifold edges before slicing.
Fit coupons for the critical dimension
A press fit (a steel bushing into a plastic bore) depends on your printer, material and settings, so measure it, do not calculate it. Print a small coupon with the bore at three sizes around the nominal, engraved with their values (wheel: 22.40 / 22.55 / 22.70 mm for a 22.45 mm OD bushing; 16 minutes of printing), test the real part in each, and set the model's bore from the winner. The 14-hour wheel print waits for that verdict.
Design for the print bed
- Choose the orientation first; then change geometry that fights it and tell the user about each deviation (in the script header and the handoff notes). On the wheel, the plastic hub was made flush with the inside plane (the bushing, pressed 3 mm proud, supplies the original standoff) and the inside sidewall made coplanar with the tread edge, so the part sits flat.
- Wheel: inside (spoke) face down, tree supports only in the open cavity under the face plate.
- Enclosure: make every wall opening a notch open at the mating face so the cover drops on with cables plugged in and prints lid-down without supports.
- PETG for outdoor mechanical parts; the 200 mm wheel was about 740 cm3, about 320 g, 14 hours on a Bambu X2D.
Gotchas
- Keep a plain-bore fallback variant if a press fit might fail.
- Slice from the same script pipeline so a corrected dimension is one command away (Slicing from the command line with Bambu Studio (flatpak), including two-color prints).
- Renders for previews: headless Blender (Eevee, or Cycles CPU when no GPU) with a fixed camera.
See also
- Slicing from the command line with Bambu Studio (flatpak), including two-color prints
- Blender Python scripting, safety audit and gotchas
- 3d.jhampton.io (print library and parametric template maker)