How to prompt AI for CAD: templates and AI CAD prompts that work
A good AI CAD prompt reads like a short spec: what the part is, its overall size in millimetres, each feature with a number, the hardware it uses and how tightly parts should fit. Give the CAD Agent those five things and it can usually build a printable part on the first turn.
- Name the part and its job: "wall bracket for a 25 mm rod".
- Give the overall size in mm.
- List features with sizes: holes, slots, ribs, chamfers.
- Name the hardware and the fit: "M3 heat-set inserts", "0.2 mm gap per side".
- After the first build, change one thing per message.
An AI CAD prompt template
Fill in what you know and delete the rest. Each line answers a question the agent would otherwise have to guess or ask.
[What it is], for [what it does or attaches to].
Overall size: [W] × [D] × [H] mm.
Features:
- [feature, with sizes and position]
- [feature, with hardware name and hole size]
Fit: [gap per side where parts meet].
Printing: [material, which face goes on the bed, no supports].
The same template, filled in:
Cable tray that screws under a desk. Overall size: 300 × 80 × 60 mm. Features: an open-top U channel with 3 mm walls; two 40 mm wide mounting tabs on the top edges, each with two 4.5 mm holes for wood screws; 10 mm wide drain slots every 50 mm along the bottom. Printing: PETG, printed upside down so the tabs sit on the bed, no supports.
What the agent sends back
Before it writes geometry, the agent posts a design brief. Here's roughly what one looks like for the L-bracket in the examples:
Model: L-bracket, single part
Units: mm; bottom at Z = 0; +Z up
Envelope: 40 × 20 × 40 mm (X × Y × Z)
Features: two legs, two side gussets, four M3 clearance holes
Wall/shell: 4 mm plates, 3 mm gussets
Defaults adopted: $fn = 64
Validation targets: bbox 40 × 20 × 40, hole count 4
It follows the brief with a 3–8 step checklist, then the code. The envelope is a promise: after the render, the app compares the real size with it and warns you if they differ by more than 1 mm. Read the brief before the 3D view. A wrong number there is the cheapest thing to fix.
If something important is missing and there's no sensible default, the agent asks 2–5 short questions with clickable answers instead of guessing.
The five details every CAD prompt needs
| Detail | What to give | Example |
|---|---|---|
| Purpose | What it is and what it holds, mounts to or fits inside | "Holder for a 25 mm broom handle" |
| Size | Overall size in mm, not "small" or "big" | "60 × 40 × 30 mm" |
| Features | Each hole, slot, rib or edge treatment, with a size and position | "Two 4.5 mm holes, 40 mm apart" |
| Hardware | Standard names plus the key dimension | "M3 heat-set inserts, 4.2 mm holes" |
| Fit and printing | Gaps where parts meet, material, bed face | "0.3 mm gap per side, PETG, flat side down" |
Symmetry is worth one extra sentence when it applies: "mirror the holes left to right" or "six spokes evenly spaced".
Units: say millimetres
OpenSCAD numbers have no units. The CAD Agent treats them as millimetres, and slicers import STL files as millimetres too. Write "mm" anyway, especially on small values. "A 0.5 chamfer" is clear to you, but "a 0.5 mm chamfer" can't be misread.
If you measure in inches, put the unit on every number and check the converted sizes in the brief.
Name the hardware, then give the number
The agent has built-in defaults for common small hardware, like M2 to M5 clearance holes, M3 heat-set inserts and M3 and M4 nut pockets. For anything else it relies on general knowledge, which can be wrong. So name the part and give the dimension that matters.
| Hardware | Numbers to put in the prompt |
|---|---|
| M3 screw through a part | 3.4 mm clearance hole (3.2 mm for a close fit) |
| M3 × 5.7 mm heat-set insert | 4.0 mm hole per the maker, or 4.1–4.2 mm if your holes print small; at least 6.7 mm deep if blind |
| 608 bearing | 22 mm outside, 8 mm bore, 7 mm wide |
| NEMA 17 stepper | Four M3 holes on a 31 mm square, 22 mm centre boss, 5 mm shaft |
| Raspberry Pi 4 | 85 × 56 mm board, four M2.5 holes on a 58 × 49 mm pattern |
In Advanced mode you can also reference the built-in hardware list directly, for example @hardware[bearing_608zz]. See the agent guide for the reference picker.
How to ask for tolerances and fits
Say the fit you want and give the gap per side. "0.2 mm clearance" is ambiguous: it could mean 0.2 mm in total or on each side, and that's a factor of two.
- Snug: "lid fits inside the walls with a 0.2 mm gap per side."
- Moving: "hinge pin hole 0.3 mm larger than the pin on each side."
- Press fit: "608 bearing seat, 22.1 mm diameter, for a press fit."
- Loose: "cable slot 1 mm wider than the cable on each side."
For starting values and a printable fit test, see 3D printing tolerances and clearance.
Follow-up prompts: small and targeted
Once the part exists, change one thing at a time and say what should stay the same. The agent receives your current code and a picture of the render with every message, so it can work from what's on screen.
- "Make the two mounting holes 4.5 mm. Keep their positions."
- "Move
@feature[mounting_holes]to a 25 × 25 mm pattern." - "Add a 0.5 mm chamfer to the bottom edges only."
- "Replace
@feature[corner_holes]with 8 mm long slots."
In Simple mode, describe the part in words ("the holes on the back plate"). @feature chips are in Advanced mode. If a message only sets existing parameters by name, like set wall_thickness to 3, the change is applied instantly without an AI call.
AI CAD prompt mistakes to avoid
| Avoid | Why | Better |
|---|---|---|
| "Make it look cool" | The agent has to guess what you like. | "Add a 2 mm chamfer on all top edges." |
| "A bit bigger" | Bigger where? The outside, the holes or the walls? | "Make it 40 mm long. Keep the holes 8 mm from each end." |
| "Rewrite the whole thing" | You lose the parts that were already right. | "Replace the lid with a sliding lid. Keep everything else." |
| "Fix it" | The agent can't see your print. | "The M3 holes are too tight. Make them 3.5 mm." |
| Five changes in one message | Harder to check, and one mistake hides the rest. | One change, check, then the next. |
AI CAD prompts to copy
Each card opens the agent with the prompt typed in. Nothing is sent until you press Enter, so edit the numbers to match your parts first.
Raspberry Pi bracket for 2020 extrusion
L-bracket that mounts a Raspberry Pi 4 to 2020 aluminium extrusion. Upright plate 70 × 60 × 3 mm with four standoffs, 6 mm tall and 6 mm across, with 2.2 mm pilot holes for M2.5 screws on the Pi's 58 × 49 mm hole pattern. Base leg 70 × 20 × 4 mm with two 5.5 mm holes 40 mm apart for M5 T-nut screws. Two triangular gussets between the legs.
Project enclosure
Project box 100 × 60 × 35 mm outside, 2.4 mm walls, 2 mm floor, 4 mm outside corner radius. Four standoffs 8 mm tall on an 80 × 40 mm pattern, each with a 4.2 mm × 6.7 mm deep hole for an M3 heat-set insert. A 12 × 7 mm USB-C cable slot in one short wall. A separate lid with a 3 mm lip that fits inside the walls with 0.2 mm clearance per side.
NEMA 17 motor mount
Motor plate for a NEMA 17 stepper: 60 × 60 × 5 mm with a 23 mm centre hole for the 22 mm boss, four 3.4 mm holes on a 31 mm square pattern with 6.5 mm counterbores 3 mm deep on the side away from the motor, and two 5.5 mm wide, 10 mm long slots along one edge for mounting.
Spur gear
Involute spur gear using BOSL2: 24 teeth, module 2, 20° pressure angle, 6 mm thick, 8 mm bore with a 3 mm wide, 1.5 mm deep keyway, and a 16 mm diameter hub 4 mm tall on one face.
Gridfinity-style storage bin
Gridfinity-style bin, 2 × 1 cells on a 42 mm grid (83.5 × 41.5 mm outside), 3 units (21 mm) tall, 1.2 mm walls. Flat bottom with four 6.5 mm × 2.4 mm deep magnet pockets per cell on a 26 mm square, and a 45° label shelf along one long wall.
This prompt gives a flat-bottomed bin with Gridfinity sizes. For bins that lock into a Gridfinity baseplate, the bin generator makes the stepped foot for you.
Twisted vase
Hexagonal vase 120 mm tall, 70 mm across the corners at the base, 15% wider at the top, twisted 90° from bottom to top. One solid body so I can print it in spiral vase mode.
Plain-language prompt for Simple mode
A hook for my bike helmet that screws to the wall. The helmet is about 26 cm long, so the hook should stick out about 10 cm and have a rounded end.
Expect a question or two back, about screw size or wall type for example. Answering them is part of the prompt.
Want the code behind prompts like these? The AI CAD examples pair each prompt with tested OpenSCAD.
When to attach an image
Attach an image when words get long-winded:
- Copying an existing part: a straight-on photo with a ruler next to it, plus the key sizes in your message.
- Matching something it mounts to: a datasheet drawing or a screenshot of the hole pattern.
- A shape that's hard to describe: a sketch with the main sizes written on it.
Images help with shape. Numbers still come from your text. See image to CAD for the full workflow.
Check yourself
Which prompt is most likely to get a finished, correctly sized part on the first turn?
The third prompt gives purpose, size, features and hardware sizes, so the agent has nothing to guess. The first two will get questions back, or defaults you might not want.
Frequently asked questions
What makes a good AI CAD prompt?
Say what the part is and what it does, give the overall size in millimetres, list each feature with its size, name any hardware it uses, and state the fit you need where parts meet. One short paragraph with those numbers usually gets a finished part on the first turn.
Should I write CAD prompts in millimetres or inches?
The PrintPal CAD Agent works in millimetres unless you say otherwise, and slicers expect millimetres too. If you measure in inches, write the unit next to every number and check the sizes in the agent's brief.
How long should an AI CAD prompt be?
As long as it needs to be to carry the numbers, which is usually two to six sentences. The CAD Agent accepts up to 4,000 characters per message. For complex parts, build the main body first and add features in follow-up messages.
Why does the CAD agent ask questions instead of building?
It asks when a detail is missing and there is no sensible default, such as how a part mounts. It asks 2 to 5 short questions with clickable answers. If a reasonable default exists, it uses it, lists it in the brief and builds straight away.
Sources
- CNC Kitchen heat-set insert dimensions and design guidelines (PDF)
- ISO 273 clearance holes; ISO 15 rolling bearing dimensions (608: 8 × 22 × 7 mm)
- NEMA ICS 16 frame size 17 mounting dimensions; Raspberry Pi 4 Model B mechanical drawing (Raspberry Pi Ltd)
Try a prompt in the CAD Agent
Start from a template above, change the numbers, and read the brief before you look at the model.
Tools for thisAll tools
Watch it doneVideo library
Thanks! We read every note and use them to decide what to update next.