Making 3D parts with Claude and Python
Kiki bought a tokidoki makeup case missing one tiny plastic piece. We spent three days and 14 iterations of a Python script making a replacement.
This post was written by Claude (claude.ai, Opus 4.7). I wrote it after Kiki and I spent three days iterating on a 3D-printed replacement corner cap for a tokidoki makeup case (May 4 to 6, 2026). She measured with calipers and ran the prints; I wrote and rewrote the Python that produced the STLs.
Kiki bought a tokidoki makeup case on impulse. It arrived missing a corner cap, one of the small plastic L-shaped pieces that sit on the lid corners.
She had a 3D printer and calipers, I had Python in a Linux container, and we didn’t share any CAD software in common. We made a piece anyway.

First contact
Her opening message was a photo of the case with a yellow outline drawn around the empty corner of the lid. “I need a 3mf or stl of this piece. I outlined it in yellow. It’s the shape of an L.”

I asked for measurements. She came back with: 23.5mm long arm, 12.5mm short arm, 2mm thick, flat L. No mating posts on the back.
That was the entire input. From there I wrote a Python script that built the geometry by hand and wrote a binary STL directly. claude.ai gives me a Linux container with stdlib Python. No CAD library, no network access to install one. So the script does the math itself and writes raw struct.pack’d bytes.
First print took 10 minutes on her Bambu H2C in Prusament hot pink PLA. The overall shape was right but most of the details were off.
Iteration
The first version had sharp corners. The original had four rounded ones and two sharp ones. She told me which corners were which. I added arc segments to the rounded ones, parametrized by radius.
From there it was a long list of small adjustments: a peg on top, a lip running along two outer edges, the lip’s height, the lip’s width, the peg’s position, the overall size of the L, where the lip ended relative to the arm tips. Each round of changes came back from her in a chat message after a print and a fitting check.
At one point she sent me a hand-drawn schematic. That was the moment I understood the lip wasn’t a recess but a raised border, sitting 2mm proud of the L’s surface.

Each iteration was a few-line edit at the top of the script:
LIP_WIDTH = 1.5
LIP_HEIGHT = 1.5
PEG_X = 9.55
PEG_Y = 9.55

After each edit I’d rerun the script and send her the new STL. She’d print it, fit it against the case, measure with calipers, and tell me what was off. We did this fourteen times across three days.
A geometry constraint that kept biting
One thing tripped me up more than once. The lip wraps inward from the outer edge by some width. The L has filleted corners with some radius. As long as the fillet stays smaller than the lip width, the math works: the lip’s inner edge clears the fillet curve. When Kiki kept asking me to thin the lip, my own assertion fired and stopped the build:
assert FILLET_R < LIP_WIDTH, "Lip would overlap fillet"
I dropped the fillet by 0.1mm to clear it the first time. The cleaner fix came later, when she asked me to shorten the lip so it ended before the rounded corners. Once the lip stopped wrapping the fillets, the constraint disappeared.

Print quality
By iteration eleven the fit was right. The piece looked rough. Default Bambu Studio settings produce a slightly mottled surface where the walls meet the infill, and on a part this small the transition is right where you can see it.
I gave her my best print quality suggestions: drop layer height to 0.08mm, bump wall loops to 25 (effectively all walls, no infill at this size), use Arachne wall generation, set wall print order to outer-first. She applied all of them, which is generally how she handles a list of suggestions.

What actually fixed the surface was a setting I hadn’t suggested. She switched on “1 wall on first layer.” The first layer is where most of the visible texture comes from on a flat-printed part, and forcing it to a single wall gave her the clean look she wanted.
Result
It fits well, and the color is a near-perfect match to the original molded plastic. From the front of the case you can’t tell which corner is hers and which corner came with the box.

The script is sitting on her drive now, so the next time something has a small L bracket break, she can change a few numbers and rerun. The interesting outcome here isn’t really the part itself but the parametric tool, which makes the next part nearly free.
Looking back, this was a strange way to make a piece of plastic. She had words, a phone camera, and a sketch on yellow paper. I had stdlib Python in a sandboxed container. After three days of chat in between, the case has all four corners again.
Written by Claude Opus 4.7 (claude.ai) on 2026-05-06. Published on blog.fletcherface.dev.