← Home

Designing Printed Parts with AI

Two prompts I use to get an AI assistant from “I want a printed thing that does X” to a part that fits on the first real print. A few people asked for them, so here they are, with one part walked through from start to finish.

AI assistants are good at writing CAD code now. They are not, on their own, good at designing parts. Left alone they guess dimensions from photos, pick a concept you never agreed to, model it beautifully, and announce “no supports needed” about a part with an 89 mm bridge in it. Every one of those happened to me.

The fix is not a smarter model. It is splitting the work in two, and making the model stop and ask at the points where a wrong guess is expensive.

The two prompts

The split is the point. The concept stage is where the expensive mistakes live: wrong position, wrong size, a retention idea that cannot work. Catching those in a paragraph costs a minute. Catching them in a finished model costs the session.

What you need

How to use them

  1. Download both files and drop them somewhere your assistant can read, like a prompts/ folder.
  2. Start a session and say something like: “Run prompts/cad-concept.md. I want a mount that holds my router on the wall above the outlet,” plus a photo or two.
  3. Answer its questions. It will ask where the thing goes, how big it is allowed to be, what it must not block, and how it should look. Then it writes a measurements.md file for you to fill in with real numbers.
  4. Read the concept. Push back, or approve it. Only then does it write the spec.
  5. In a fresh session (or a different model, if you like), say “Run prompts/cad-detailed-design.md on prints/router-mount/design-spec.md.”
  6. Print the coupon first if it gives you one. Report back what happened. Then print the part.

An example: casters for an IKEA frame

I wanted small ball casters under an IKEA JONAXEL storage frame so it would roll instead of drag. The frame's legs end in a knurled plastic leveling bolt, and the casters came with a flat, round flange and four screws.

Concept. The concept stage read the photos, asked for the measurements it could not get from them (bolt thread, head diameter, how many ridges on the knurl, the caster's screw spacing), and proposed a printed puck: the frame's own bolt head sits in a keyed pocket on top, the caster screws to the bottom, and spinning the puck by hand turns the bolt, so leveling still works. It wrote all of that into a spec with every number tagged as measured, published, or assumed, and asked me to pick CadQuery or OpenSCAD before writing it. I picked CadQuery.

Detailed design. A separate session built it from the spec: a parametric model, a printability table showing no supports were needed, and a small coupon with four pockets at different clearances to test the fit before printing four full pucks.

Renders of the printed puck from the top and bottom, a four-pocket test coupon, and an optional lock wheel.
The puck, the test coupon, and an optional lock wheel

Where it went wrong, usefully. The spec included a little snap lip at the top of the pocket to hold the bolt in, justified with a strain calculation. On the coupon, the bolt would not go into any of the four pockets. The math assumed a ring that could stretch, and a lip cut into solid plastic is not a ring that can stretch. I shaved the lip off with a knife, and the coupon gave a real answer: 0.20 mm clearance was loose, 0.10 worked, and the final pucks went to 0.08, which fits almost perfectly. Three pucks at that number, no more test prints.

Two things came out of that, and they are the habit I would most like you to steal. The fit went into a measured fits table in my printer notes, so the next part starts from 0.08 instead of a guess. And both prompts gained a rule: a press or snap fit is unproven until a coupon tests it, and the detailed design re-checks any calculation it inherits from the spec.

How these were made

They started as one long prompt for a wall mount for my Wi-Fi router, above a kitchen outlet. I gave that same prompt to three different AI models and let each one produce a full CAD package on its own: concept, model, print settings, and a review of its own work.

Then I judged the results by measuring the exported parts, not by reading what each model said about them. Every bridge, every overhang, whether the mesh was even a closed solid. That mattered. One run's instructions said “no supports, do not rotate” over an 89 mm bridge that would have printed into thin air. Its own review had missed it.

The useful finding was not which model won. It was that all three made the same mistakes, and when three different models get something wrong the same way, the problem is the brief.

The models did differ. One found constraints nobody had mentioned, one got to a buildable part fastest, one needed the most steering. But that was one part and one run each, which is an anecdote, not a benchmark. The prompt fixes are what held up.

They are built out of mistakes

That was the first round. Almost every rule in these prompts traces to a specific failure, and the end of each file says which. A magnetic photo-album cover that took sixteen revisions, nearly none of them about taste, mostly about a strip of double-sided tape. That history is worth reading even if you never run the prompts. It is also why they are long.

So do the same thing. When something goes wrong, add one line to the prompt saying what to do differently and where the lesson came from. Within a few parts, the prompt knows your printer better than any general advice does.

Make them yours

If you try them, I would love to see what you make. Write to me at me@viyatjhaveri.com, especially if something breaks, since that is exactly how the next rule gets written.

— Viyat