Prompting for AI CAD
Prompting a CAD agent is closer to writing a one-paragraph engineering brief than chatting with a chatbot. The agent rewards specificity about envelope, hardware, and fit. This page is a field guide of templates, anti-patterns, and tweaks that turn first-turn renders into printable parts.
A reliable prompt template
Use this skeleton for any mechanical part. Fill in or drop sections as you need them:
[part type], [envelope size in mm].
Made of: [material / printability target].
Features:
- [feature 1, with sizes]
- [feature 2, with hardware spec]
- [feature 3, with tolerance]
Fit / mate: [what it mounts to or fits inside].
Constraints: [orientation, supports, max wall thickness, anything to avoid].
Concrete example
M3 corner bracket, 30 × 30 × 4 mm envelope.
Made of: PLA, FDM-printed flat.
Features:
- Two countersunk M3 holes per leg
(3.2 mm clearance, 6 mm head, 1.7 mm depth)
- 2 mm chamfer along the inside corner
- Stiffening rib on the back, 3 mm thick
Fit: aluminum extrusion 20×20 V-slot.
Constraints: avoid overhangs > 45° on the
default print orientation.
What the agent commits to
Envelope: 30 × 30 × 4 mm ✓
Features:
· @feature[leg_a]
· @feature[leg_b]
· @feature[corner_holes_a]
· @feature[corner_holes_b]
· @feature[corner_chamfer]
· @feature[back_rib]
Hardware: M3 flat-head × 4
Brief check: bbox 30.00 × 30.00 × 4.00 mm ✓
Manifold: ✓ Watertight: ✓
Min wall: 2.0 mm ✓
Be specific about the four S's
| S | What to specify | Example |
|---|---|---|
| Size | Bounding box in mm. Avoid "small" / "medium" / "big". | "30 × 30 × 4 mm" |
| Specs | Hardware standards (M3, NEMA17, 1/4-20, ISO 7380…) | "M3 clearance hole, 3.2 mm" |
| Surfaces | Where things mate, what they touch, what stays flat. | "Bottom face mates to 20×20 V-slot" |
| Symmetry | Mirror axes, polar arrays, repeated features. | "Symmetric across the YZ plane" |
Always say "mm"
OpenSCAD is unit-agnostic — internally everything is just a number. By convention, every PrintPal generation treats the unit as millimetres, and slicers import the same way. Spell it out in the prompt to avoid ambiguity, especially when you reference small dimensions (a "0.4 chamfer" could mean 0.4 mm or 0.4 in — say "0.4 mm").
Hardware specs by name
The agent recognises common fasteners and motor footprints. Use the standard name and let it pick the right clearance + countersink dimensions:
- Screws: M2, M2.5, M3, M4, M5, M6, M8 (metric); #4-40, #6-32, #8-32, #10-32, 1/4-20 (imperial).
- Head types: pan, button, flat / countersunk, socket-cap.
- Inserts: heat-set (M3 → 4.0 mm bore × 5 mm deep is typical).
- Motors: NEMA17, NEMA23, 28BYJ-48.
- Bearings: 608ZZ (skate), MR105, F608, LM8UU (linear).
- Profile: 20×20 V-slot, 30×30 T-slot, 2020 / 2040 extrusion.
Tolerances
For things that have to mate, ask for the right slip-fit clearance up-front rather than fighting it later:
- Push-fit: 0.0–0.1 mm clearance.
- Slip-fit: 0.2 mm clearance (the default for hardware holes the agent generates).
- Loose fit / cable pass: 0.5–1.0 mm clearance.
- Snap-fit lip: 0.3 mm interference, with a 1–2 mm-tall lip.
Example phrasing: "M3 hole with 0.2 mm slip clearance" or "bore for 608ZZ with 0.1 mm press fit".
Iteration: small, surgical asks
Once the part exists, prefer targeted changes anchored on @feature references:
- "Make
@feature[main_bore]1 mm wider." - "Move
@feature[mounting_holes]to a 25 × 25 mm pattern." - "Add a 0.4 mm chamfer along the top edge of
@feature[boss]." - "Replace
@feature[corner_holes]with slots 8 mm long."
Anti-patterns
| Avoid | Why | Better |
|---|---|---|
| "Make it look cool" | Subjective. The agent has to guess. | "Add a chamfer on all top edges and a 2 mm fillet on the inside corners." |
| "A bit bigger" | Vague. May change envelope, holes, or wall. | "Increase the bracket length to 40 mm. Keep hole positions relative." |
| "Rewrite the whole thing" | Loses your @feature references. |
"Replace @feature[X] with [Y]. Keep everything else." |
| "Fix it" | Fix what? The agent doesn't see your printer or your eye. | "The hole in @feature[X] is 0.3 mm too tight for M3. Increase clearance." |
Reference prompts
Mechanical bracket
L-bracket for mounting a Raspberry Pi 4 to a
20×20 V-slot. Pi mounts on the 56 × 49 mm
hole pattern. Bracket envelope ≤ 70 × 70 × 4 mm,
3 mm wall, M3 countersunk on the V-slot side.
Symmetric across the YZ plane.
Enclosure
Project box, 100 × 60 × 35 mm OD, 2 mm wall,
2 mm corner fillets. Removable lid with four
M3 brass-insert standoffs (4 mm bore × 5 mm deep)
on a 92 × 52 mm pattern. Internal lip for the
lid to seat into, 1 mm deep × 1 mm tall.
USB-C cutout centered on a short side,
9 × 4 mm with 0.5 mm clearance.
Gear
Involute spur gear, 24 teeth, module 2,
8 mm bore with a 6 mm-long keyway 3 mm wide
× 2 mm deep. 6 mm thick. 0.4 mm chamfer on
both faces of every tooth.
Storage bin (Gridfinity-style)
Gridfinity bin, 2×1×3U (84×42×21 mm cells),
single internal cavity, magnet holes on the
base for 6×2 mm magnets (8 mm overall depth).
Label tab on the long side.
Vase
Hexagonal twisted vase, 60 mm tall,
30 mm OD at the base, 24 mm at the top,
180° total twist. Single 0.6 mm wall
(spiral / vase-mode printable).
When to attach images
Reach for an image when words run out:
- Recreating an existing part: photo from above + side, plus a ruler in frame for scale.
- Mounting to something: a screenshot of the mating surface (PCB outline, motor spec sheet, extrusion cross-section).
- Aesthetic intent: a reference photo of the look you're going for (rounded edges, fluted profile, hex pattern).
- Hand sketch: grid-paper sketches with dimensions called out are the agent's favourite input — see Image-to-CAD workflow.
Paste any of the prompts above into the agent
They're all real prompts that produced real printable parts. Modify them for your specs and you'll be exporting STL inside a minute.