5 min read

I rebuilt my 3D prints as code: 13 designs, 40 hours, and an AI that reads triangles

Fragile scripts and downloads with no source became 13 parametric designs with 209 tests, six rebuilt from nothing but a mesh. What surprised me, who decided what, and why engineering leaders should care.
Headline "I rebuilt my 3D prints as code." beside renders of four of the designs, with the counts 40 hours, 13 designs, 6 from a download and 209 tests.

I've been 3D printing for years, and my designs have always lived in two kinds of place, both fragile.

Some are my own scripts: Python and OpenSCAD files I wrote one evening, printed, and never touched again. A few only ran on the Mac I wrote them on, because they pointed at a library folder that existed nowhere else. Others are downloads: designs from MakerWorld that I printed as-is, because a downloaded 3MF is a finished object. It's a zip of triangles, not a design you can change.

Over about forty hours across two days at the end of November, working with Claude (Anthropic's AI model, in my terminal through Claude Code), I turned both kinds into something better: 13 parametric designs, each one a short Python recipe you can resize from the command line, with 209 automated tests behind them. Six of the 13 started from nothing but a downloaded mesh.

This is the first post in a series about how that works. It's for builders, who'll want to know whether they can do it too, and for engineering leaders, who should be asking what else it applies to.

A 40-hour strip from day 1 at 02:45 to day 2 at 18:26 with 18 marks for merged pull requests, and the list of pull requests by day: 13 on day 1, 5 on day 2.
Eighteen pull requests in forty hours, each one reviewed and merged by me. Nothing merged overnight.

What I have now

Every design is a recipe: a Python file that declares its sizes as named parameters with units and ranges, the rules that make a size impossible, and the parts it makes. Ask for a box 2 cm deeper, or a case for a different lighter, and the recipe works out the rest. It writes a build record next to every STL: the exact parameters, the code version and a check that the mesh is printable.

Underneath them all is makerlib, a small library that grew as the designs did, and whose code is public. It isn't a big framework; it's the pieces that kept showing up, written once and tested: rounded boxes, screw holes from one table of sizes, magnet pockets, hinges, latches, seals, snap clips.

Twelve renders on light tiles: a Raspberry Pi 5 case, a Zippo lighter display, a bike rack attachment, a label-roll holder, a Starlink pole mount, a trekking pole mount, an AirPods laser jig, an AirTag laser jig, a self-centering jig, an ornament jig kit, a MiniLock box and a rugged box, each marked "from my own code" or "from a downloaded 3MF / STL".
Twelve of the thirteen, as the library renders them for their READMEs.

Two ways in, one way out

The seven designs that started as my own code were ports: read the old script, understand what each number was for, and rebuild it on the library. The old file stays in git history as the reference, and a test checks the new design against it: against the old code, or the STL I actually printed.

The six that started as downloads are the surprising ones. There was no code to port. Claude opened the 3MF, worked out what each object was, sliced the meshes to measure them, named the measurements, rebuilt the design on the library, and then compared the rebuild with the original by subtraction: original minus rebuild, rebuild minus original, in cubic millimetres. The rugged box I'll walk through next week matches its original's base to 0.96 % of its volume, and every part of that difference has a reason.

Two lists feeding one: seven designs from my own code and six from a downloaded 3MF or STL, each becoming one recipe with parameters, rules, tests and a build record.
Whatever the starting point, the result is the same kind of thing.

What surprised me

It reads triangles like a drawing. A mesh has no dimensions, no features and no intent. Watching it come back as "a 2 mm wall, a 4 mm chamfer, two hinges, a padlock tab" was the moment the project stopped feeling like an experiment.

The rebuild is the start, not the end. The AirPods laser jig I downloaded was made for the AirPods Pro 2. Once it was a recipe, a version for the Pro 3, whose case is a couple of millimetres bigger, was a matter of sizes, in the same half hour. When I first typed "Pro 4" by mistake, Claude checked Apple's specifications and said there's no such product before I corrected myself. I'll take that.

The library pays compound interest. Every design left something behind for the next one. The clearances come from one table of fits measured from designs I'd actually printed, so "a pin that slides" means the same 0.25 mm everywhere. By the rugged box, the 11th design, most of the work was choosing pieces, not writing them.

It checks itself, in ways I didn't ask for. Tests caught real bugs minutes after they were written. A latch test was flagged because it couldn't have failed: the pin the latch snaps onto wasn't in it. I didn't ask for either check. It's simply how the work was done.

Who decides, who builds

None of this means the AI was in charge. The split was clear from the start, and I think it's the reason the speed didn't turn into a mess.

Two columns and a band: I decide what to build and what it's for, what "right" looks like, look at every render, print and check the fit, and merge or not; Claude reads meshes and old scripts, measures and names the numbers, writes the recipe and its tests, compares with the original, and writes the READMEs, renders, build records and pull requests; both work inside written conventions, lint, tests and a repo check on every change, and no original third-party files in the repo.
Who decides and who builds, and the guardrails both work inside.

Two moments show why the human half matters: - The latches: the rugged box passed every numerical check with its latches upside down. Same volume, wrong purpose. I caught it by looking at a render. - The screws: when I went through a list of suggested improvements, one of my answers was simply "the screws worked so don't fix what is not broken." That was a decision, not a measurement, and it stuck.

Judgment about purpose stayed mine. Execution got very fast.

Why engineering leaders should care

Swap "3D print" for any artifact whose source is lost, fragile or out of reach: - a report that only one person can regenerate; - a vendor's export; - a service nobody can rebuild.

The method is the same. Recover the structure, name the intent, rebuild it on tested components, and prove equivalence by measuring the difference. AI made the first three steps fast enough to do in two days. The fourth is what makes the result trustworthy, and it's a discipline you have to insist on.

The other lesson is the one I keep learning: AI amplifies the engineering culture you give it. One project layout, one table of fits, lint and tests on every change, and no third-party originals in the repository were written down early. After that, every new design was faster and more consistent than the last, because there was a clear right way to do it.

What's next in the series

A new post every Tuesday: - Dec 8: "A 3MF in, code out." The rugged box, step by step, from 89,398 triangles to a recipe, with every picture from the session. - Dec 15: "Rebuild it, then change it." The AirPods jig, and a version for a case it was never designed for. - In January: - "my printed part is the test"; - fixing what an original got wrong while leaving what works; - how a library grows out of rebuilds; - why recreating a design isn't relicensing it.

If posts like this are useful to you, subscribe and the next one lands in your inbox.

What's sitting in your own "can't change it, only use it" pile? 🛠️

makerlib is a personal project, built on nights and weekends with Claude (Anthropic's AI model, working through Claude Code), unaffiliated with my employer. The designs rebuilt from MakerWorld downloads are for my personal use under their licences, and their designers are credited in the posts that cover them. The views here are my own. makerlib's source is public.