AI for 3D printing

Text-to-CAD prompting — engineered parts from a description

Text-to-CAD is the workflow when you need a part with dimensions — a bracket, an enclosure, a fixture, a mating jig. Unlike text-to-3D (which produces a fixed mesh), a CAD agent generates editable parametric code: you can say "wall thickness 3 mm" and get exactly 3 mm. This guide is the prompting structure that works for the PrintPal CAD Agent — and similar OpenSCAD- or Python-driven tools.

10 min read Updated May 2026 PrintPal editorial
The 30-second formula

Be specific about what, where, and how big. Start with the part type, then the bounding box, then features (holes, slots, fillets, mounting points) with their dimensions and positions. Always include a clearance allowance for mating parts (0.2 mm is the FDM default). When something isn't right, change one feature in plain English and re-render — don't re-prompt from scratch.

Why text-to-CAD prompts look different from text-to-3D prompts

Text-to-3D prompts are stylistic ("a chunky low-poly owl, cartoon style"). Text-to-CAD prompts are specification documents. The agent writes code, and the more precise your specification, the cleaner the code.

The mental model: pretend you're commissioning a part from a machinist who has never seen the application. Every dimension you forget to specify is a guess they're going to make — sometimes well, sometimes badly. Specify everything that matters, accept defaults for everything that doesn't.

Anatomy of a great text-to-CAD prompt

1. Part type and overall purpose

Start with the noun and the function. "Wall-mount bracket for a small wireless router". "Cable strain-relief grommet for a USB-C cable". "Replacement knob for a stove with a D-shaped 6 mm shaft". The function tells the agent which features are mandatory (e.g. "knob" implies a friction-fit interface) and which are optional.

2. Overall dimensions

Bounding box or critical exterior dimensions. Use real units; "L x W x H in mm" is the safe convention. Always specify mm explicitly — "30 x 60 x 12 mm" is unambiguous, "30 x 60 x 12" can be interpreted as inches in some contexts.

3. Features and their positions

For each feature (hole, slot, mounting boss, fillet, chamfer, recess) state:

  • What: "through hole", "blind hole 5 mm deep", "slot 10 mm long", "fillet", "chamfer".
  • Size: diameter, length, radius. Round to standard sizes (M3 = 3 mm; M4 = 4 mm).
  • Where: "centred", "8 mm from the left edge and 5 mm from the top", "in a 60 mm-centre pattern".

4. Mating parts and clearances

If anything has to fit something else, state the mating reference and the clearance. FDM defaults:

  • 0.2 mm clearance per side for sliding fits.
  • 0.1 mm clearance for tight push-fits.
  • 0.0 mm or -0.05 mm for press-fit threaded inserts.
  • 0.3 mm clearance for textured-bed prints (the textured layer adds ~0.1 mm).

5. Print-friendly hints (optional but powerful)

  • "Designed to print without supports" nudges the agent to chamfer overhangs at 45° instead of leaving them as bridges.
  • "Flat bottom" guarantees a printable first layer.
  • "With a 2 mm fillet on outside edges" reduces stress concentrations and produces nicer prints.
  • "Wall thickness 2 mm minimum" avoids walls thinner than a typical 0.4 mm nozzle can print well.

Worked examples

Bracket

Good: "Wall-mount L-bracket. Horizontal arm 60 mm x 30 mm x 5 mm thick; vertical arm 40 mm x 30 mm x 5 mm thick. Two M4 countersunk through-holes on the vertical arm, 10 mm in from each end, centred vertically. Two M4 through-holes on the horizontal arm, 10 mm in from each end. 3 mm fillet on all external edges. Designed to print with the vertical arm flat on the bed."

Bad: "A bracket for mounting things on the wall." (No dimensions, no holes specified, no orientation — the agent will guess all of it.)

Box / enclosure

Good: "Snap-fit enclosure with a separate lid. Internal cavity 80 x 50 x 25 mm. Wall thickness 2 mm. Lid sits inside the body with a 0.3 mm clearance and snaps in via two 1 mm lugs on each long side. 1.5 mm fillet on outside edges. Flat bottom; lid prints separately."

Bad: "A box with a lid that closes." (No size, no clearance, no snap mechanism specified.)

Replacement knob

Good: "Replacement stove knob. 35 mm diameter outer cylinder, 18 mm tall. Knurled outer surface (6 mm tall knurl band on the upper third). Central hole sized for a D-shaped shaft: 6 mm diameter with a 4.5 mm flat on one side, 10 mm deep, 0.1 mm clearance. Pointer indicator: 2 mm-wide raised line running the full radius on the top face."

Mounting bracket for a specific device

Good: "Vesa-compatible monitor mount for a 75x75 mm pattern. Backplate 100 x 100 x 4 mm. Four M4 countersunk through-holes in a 75 mm square pattern, centred. One 10 mm-diameter cable pass-through hole below the bottom-right mounting hole. Two 5 mm slotted wall-mount holes on the back, 70 mm apart horizontally."

The iteration loop

Text-to-CAD shines on iteration because the underlying model is parametric — the agent can keep the existing code and just edit the part you mentioned. Patterns that work:

  • "Make the wall 4 mm instead of 2 mm." Single-parameter edit. Re-renders in seconds.
  • "Add four M3 mounting holes, 8 mm in from each corner." Additive feature; the rest stays intact.
  • "Move the central hole 5 mm to the left." Position adjustment.
  • "Add a 2 mm chamfer to the top edge." Surface refinement.
  • "Make this 10% bigger overall." Uniform scale.
  • "Hollow it out with 2 mm walls, open from the bottom." Cavity addition.
  • "Add a label on the front: 'BAY 3', 6 mm tall, embossed 0.6 mm." Text features (text-to-CAD handles these reliably — text-to-3D does not).
Always change one feature at a time.

"Make the wall thicker, add holes, change the size, and round the corners" in a single turn is asking for trouble — if anything goes wrong, you don't know which change broke it. Edit, render, verify, edit again.

How to specify dimensions the agent will respect

PatternWhat the agent will do
"100 x 60 x 30 mm"Bounding box. Mapped to length / width / height in that order.
"60 mm diameter, 12 mm tall"Cylinder. Diameter, not radius, unless you say otherwise.
"M3 hole" / "M4 hole" / "M5 hole"Through-hole sized for the named metric screw (3, 4, 5 mm + 0.2 mm clearance).
"M3 threaded-insert hole"Hole sized for a brass heat-set insert (typically 4.0 mm for M3, 5.7 mm for M4).
"60 mm-centre pattern"Hole positions on 60-mm centres.
"10 mm in from each corner"Position offset from the corner reference.
"2 mm chamfer"45° edge chamfer 2 mm in each direction.
"3 mm fillet"Round-over with 3 mm radius.
"wall thickness 2 mm"All outer walls 2 mm thick. Specify per-face if walls vary.

Common mistakes

  • Leaving out a dimension and hoping the agent picks the right default. It usually doesn't — or it does this time, and not the next.
  • Specifying dimensions in inches without saying so. The CAD Agent assumes mm. Add "in inches" or convert.
  • Forgetting clearance on mating parts. A "5 mm hole for a 5 mm shaft" will be a press-fit at best. Use 5.2 mm for a sliding fit.
  • Asking for features the agent has no reference for. "Make it look cool" or "make it ergonomic" don't map to geometry. Be concrete.
  • Re-prompting from scratch instead of iterating. Once you have a base part you like, edit it. A fresh prompt produces a fresh part with new quirks to debug.
  • Asking for organic shapes. Text-to-CAD is for geometric / engineered parts. For sculpture, use text-to-3D.

Hybrid workflows: AI mesh + AI CAD

The best results today often come from combining the two AI approaches:

  1. Generate the artistic part with text-to-3D (a figurine, a sculpture, a custom shape).
  2. Generate the functional part with text-to-CAD (a base, a stand, a mounting interface).
  3. Assemble in the slicer by importing both STLs and positioning them together.

Examples: a custom miniature on a 25 mm round CAD-designed base; a sculpted bust on a magnetic phone holder; a 3D-scanned mug handle attached to a CAD-designed cylindrical mug body.

Related articles

Further reading