Design a 3D print with ChatGPT or Claude
AI chat assistants are good at turning "a wall hook for a 20 mm broom handle" into numbers, but they can't hand you a 3D file. FlatCad 3D closes the gap: it gives the AI a short description of its recipe format, the AI writes the part as a list of features, and you paste that back and get a real, editable 3D model you can print.
How it works
Open the AI dialog. In FlatCad 3D, click ✦ AI / Code at the top.
Describe the part. Sizes in millimetres help: "a 60 × 40 mm plate, 4 mm thick, rounded corners, four M3 countersunk holes 4 mm from the edges".
Copy the prompt. Copy prompt puts your request plus the recipe format on the clipboard. Tick include my current part to ask for a change to what you already have.
Paste it into ChatGPT, Claude or Gemini. The reply is a JSON recipe: a name and a list of features.
Paste the reply back and press Build it. Code fences and chatter around the JSON are ignored. Any feature with a problem is marked with a ! in the list.
Adjust and export. Every feature is editable in the Properties tab, then Export → STL or 3MF.
Why a recipe and not a mesh
When an AI writes a mesh or OpenSCAD code, a small mistake means asking again and hoping. A FlatCad recipe is a short list of named features, a box, a hole, a pattern, so you can see exactly what the AI meant and fix one number yourself. The Recipe code tab shows the whole part as JSON, for anyone who'd rather edit it by hand.
A worked example: a clip for a broom handle
Here is the whole loop for one real part, a clip that screws to a wall and holds a 20 mm broom handle. The request typed into the dialog was:
a wall clip for a 20 mm broom handle: 70 × 15 × 5 mm back plate, a ring that the handle snaps into from the front, two countersunk M4 screw holes
A good reply is a recipe like the one below. Every line is one feature, applied in order:
{"name":"Broom handle clip","features":[
{"id":"plate","type":"box","size":[70,15,5],"corner":3},
{"id":"ring","type":"cylinder","d":28,"h":15,"at":[0,7.5,18],"rot":[90,0,0]},
{"id":"bore","type":"cylinder","d":20.6,"h":17,"at":[0,8.5,18],"rot":[90,0,0],"op":"cut"},
{"id":"mouth","type":"box","size":[16,17,20],"at":[0,0,18],"op":"cut"},
{"id":"s1","type":"hole","d":4.5,"depth":6,"csink_d":9,"at":[-26,0,5]},
{"type":"mirror","plane":"x","of":"s1"}
]}
Reading it top to bottom:
- plate is a box centred on the origin and sitting on the bed, so it runs from −35 to +35 mm in X, −7.5 to +7.5 in Y, and 0 to 5 in Z.
cornerrounds the four vertical edges with a 3 mm radius. - ring is a 28 mm cylinder turned 90° about X, so its axis lies along Y at a height of 18 mm. Its bottom dips 1 mm into the plate, which joins the two solidly instead of letting them touch along a line.
- bore cuts the 20.6 mm hole for the handle: 0.3 mm of clearance on each side, and 3.7 mm of wall left in the ring. It is 17 mm long, 2 mm longer than the ring, and starts 1 mm further out, so it pokes out of both faces.
- mouth is a 16 mm wide box cut from the axis upward. It opens the top of the ring, leaving a 16 mm gap that the 20 mm handle has to push through: that squeeze is the snap.
- s1 is a hole drilled down from the top of the plate at z = 5, with a 9 mm countersink for an M4 flat head, and mirror copies it to x = +26. A mirrored hole cuts just like the original, so editing the diameter of
s1changes both.
After Build it, the readout in the corner says 70 × 15 × 29.5 mm, 8.11 cm³ and about 10 g of PLA if printed solid. The part prints as it sits: the plate is flat on the bed, and the ring stands up from it.
Fixing a recipe in the editor
The first version is rarely the one you print, and the point of a recipe is that you can change one number instead of asking again. For this clip, the obvious candidate is the mouth. A 4 mm squeeze through 3.7 mm PLA walls is on the stiff side, and a PLA ring flexed too far cracks at the thinnest point rather than springing back. Click the mouth feature in the list and change its first size from 16 to 17, and the ring rebuilds with a gentler snap. PETG bends further before it breaks, so in PETG the 16 mm mouth is a reasonable place to start. Print just the ring first if you can: the handle you have is the only real test, and a 15 mm slice of ring costs a few minutes.
The other numbers worth checking against your own hardware are the bore and the screw holes. Measure the handle with calipers rather than trusting the label, then set the bore 0.5 to 0.6 mm larger and keep the mouth about 3 to 4 mm smaller than the handle. The 4.5 mm holes are clearance for M4; for wood screws, measure the screw's thread and head and set d and csink_d a little over each.
Where AI recipes go wrong
FlatCad quietly repairs the small slips a chat assistant tends to make in the format: cube and cyl become box and cylinder, "op": "subtract" becomes a cut, a radius r is turned into a diameter, and a feature of an unknown type is skipped with a message rather than stopping the build. The mistakes it cannot guess are about position and direction, and they show up as a part that looks wrong rather than an error:
- Holes in the wrong place. Boxes are centred in X and Y, but a common slip is to assume the corner sits at the origin and put a hole "4 mm from the edge" at x = 4, which lands it near the middle of a 70 mm plate. The fix is the hole's at value: for a plate 70 mm wide, 4 mm from the edge is x = ±31.
- A hole that doesn't go through. A hole is drilled down from its at point, so at must be on the top surface. If the AI gives z = 0 for a hole in a 5 mm plate, the hole points into the bed and leaves only a shallow dimple underneath. Set z to the plate's thickness, and make the depth a millimetre more than the plate.
- A part turned the wrong way. Rotations follow the right-hand rule, and the sign is easy to get backwards. In the clip above,
"rot":[-90,0,0]instead of 90 swings the ring off the back of the plate: the readout jumps from 70 × 15 × 29.5 to 70 × 30 × 32 mm, and the bore and mouth no longer line up with the ring, so it comes out closed. When the size readout disagrees with the size you asked for, look at the rotations first. - A pattern or mirror that points at nothing. A pattern or mirror names an earlier feature by its id. If the AI renames a feature or puts the pattern first, the build says pattern source "s2" not found (must come earlier) and marks it with a !. Correct the of value, or move the feature down the list.
- Walls too thin to print. The format asks for walls of at least 1.2 mm, three lines of a 0.4 mm nozzle, but an AI shrinking a part to fit your sizes will happily make a 0.8 mm wall. Check the thinnest section and thicken it; a cut box or bore is usually the number to change.
- Inches. Recipes are in millimetres. If you give sizes in inches without saying so, the part arrives 25.4 times too small, and the readout gives it away immediately.
For bigger changes, tick include my current part and describe the change. The prompt then carries your recipe and asks the AI to keep the feature ids stable, so the reply changes what you asked for and leaves the rest alone.
Prompts that work
- "A cable clip for a 6 mm cable that screws to a desk with one M4 screw, 3 mm walls."
- "A 90 × 60 × 30 mm parts tray with four equal compartments and 2 mm walls."
- "A knob for a 6 mm D-shaft, 30 mm across, with a fluted edge."
- "Make the holes in my part 4.5 mm and add the text 'GARAGE' on top." (with include my current part ticked)
The recipe format is also published at flatcad.com/3d/llms.txt, so an assistant can read it directly and give you a link that opens the part.
Open FlatCad 3D, free, no signup
Questions
Does FlatCad send my description to an AI?
No. FlatCad 3D builds a prompt and copies it for you; you paste it into whichever AI chat you already use. Nothing is sent from FlatCad to an AI service.
Which AI works best?
Any chat assistant that can write JSON: ChatGPT, Claude and Gemini all work. Give sizes in millimetres and say what the part attaches to; the more precise the description, the better the first try.
The AI's part has a mistake. Do I start over?
No. Fix it like any other part: click the wrong feature and change its numbers, or tick 'include my current part', describe the change, and paste the AI's new reply.
Can an AI open a part in FlatCad 3D directly?
Yes. A link of the form flatcad.com/3d/#json= followed by the URL-encoded recipe opens that part. The format is described for AI assistants at flatcad.com/3d/llms.txt.
Is the result a mesh or real CAD?
Real features: boxes, holes, text, patterns and so on, each with numbers you can edit. You export STL or 3MF only when you're ready to print.