AI for 3D printing

Text-to-CAD prompts: how to get dimensioned, editable parts from AI CAD

A text-to-CAD prompt works like a spec sheet. Give the overall size in millimeters, then each feature with its size, position and fit, and name standard hardware like "M3 clearance hole". The AI turns that into a parametric model you can edit, so every number you write is a number you can change later.

8 min read Updated October 2026 Intermediate AI for 3D Printing · 5 of 8
In short
  1. Start with the envelope: "60 × 40 × 5 mm plate".
  2. List features with numbers: size, position from an edge or the center, depth.
  3. Name the hardware: "M3 clearance", "M4 heat-set insert", "608 bearing".
  4. State the fit: press, sliding, or a clearance in mm.
  5. Iterate one change at a time, and use sliders for pure size tweaks.

Text-to-CAD vs text-to-3D

Text-to-CADText-to-3D
OutputParametric solid (code or CAD features)Triangle mesh
DimensionsExactly what you asked forApproximate, no real units
EditingChange a number, the part rebuildsRe-generate or edit the mesh by hand
Holes, threads, cavitiesReliableUnreliable
Organic shapesAwkwardExcellent
Best forBrackets, enclosures, adapters, jigs, spare partsFigurines, props, decor

If a part screws to, slides over or snaps onto something, use text-to-CAD. If it sits on a shelf looking good, see the text-to-3D prompting guide.

How PrintPal's CAD Agent turns a prompt into a part

The CAD Agent writes OpenSCAD code and renders it in your browser, with the BOSL2 and MCAD libraries pre-installed. On each request it:

  1. Checks whether it has enough to go on. If a critical number is missing and no sensible default exists, it asks a few quick clarifying questions with suggested answers. Otherwise it fills gaps with stated defaults.
  2. Writes a brief: units, origin, overall size and the feature plan. Read it. It's the fastest place to spot a misunderstanding.
  3. Lists a checklist of the features it's building, then writes the complete model.
  4. Optionally self-checks. With Auto-iterate on, it renders the model from several angles and critiques it against your reference image or the fit of mating features, for up to two rounds.

The code comes out parametric, with named values at the top. In Simple mode (the default) those appear as sliders in the Adjust tab; Advanced mode adds the code editor. Moving a slider re-renders in your browser without another AI request. A finished model looks something like this:

// Named parameters at the top are what you adjust
width = 60;      // mm
depth = 40;      // mm
thickness = 5;   // mm
hole_d = 3.4;    // M3 clearance hole
inset = 5;       // hole center distance from each edge

difference() {
  translate([-width / 2, -depth / 2, 0]) cube([width, depth, thickness]);
  for (x = [-1, 1], y = [-1, 1])
    translate([x * (width / 2 - inset), y * (depth / 2 - inset), -1])
      cylinder(d = hole_d, h = thickness + 2, $fn = 32);
}

Signing in is required for the AI chat, and each AI turn uses credits based on the work it does. See the CAD Agent guide for the full tour.

Anatomy of a good text-to-CAD prompt

  1. What it is: "a wall-mount bracket for a 25 mm pipe".
  2. The envelope: overall width, depth and height in millimeters.
  3. Features, one by one: each hole, slot, boss or cutout with its size and its position measured from an edge or the center.
  4. Hardware and fits: "M3 heat-set inserts", "0.2 mm clearance around the board".
  5. Finishing: fillets, chamfers, text, and which face sits on the bed.

When you're vague, the agent fills in its defaults and says so in the brief: millimeters, centered on the origin with the bottom at Z = 0, 2.4 mm enclosure walls, and an Ender-3-class 220 × 220 × 250 mm bed. It warns you if a part grows past 200 × 200 mm.

Clearances and hardware sizes

These are the starting values the CAD Agent uses when you don't specify. Every printer is a little different, so print a test piece for anything critical.

FeatureStarting value
Press fit0.15–0.20 mm per side (0.10 tight, 0.30 loose)
Sliding fit0.25–0.40 mm per side
Printed threads0.15–0.25 mm per side on the internal thread
M3 / M4 / M5 clearance hole3.4 / 4.5 / 5.5 mm (3.2 / 4.3 / 5.3 for a close fit)
Self-tapping screw pilotScrew size minus 0.4 mm (M3 → 2.6 mm)
M3 heat-set insert4.2 mm hole, 5.7 mm deep, in a 6–7 mm boss
M3 / M4 hex nut trap6.0 / 7.0 mm across flats, 2.5 / 3.2 mm deep
Minimum wall1.2 mm, 2.0 mm for anything structural
Unsupported overhang45° from vertical

For heat-set inserts from other brands, check the maker's hole size. CNC Kitchen's M3 inserts, for example, are modeled at about 4.0–4.2 mm, with a blind hole about 1 mm deeper than the insert.

Text-to-CAD prompt examples you can copy

Each card opens the CAD Agent with the prompt filled in. It never sends on its own, so you can edit first.

Mounting plate 60 × 40 × 5 mm with four M3 clearance holes, each 5 mm in from both edges at the corners. 3 mm fillets on the four vertical corner edges. Centered on the origin, bottom face at Z = 0.

L-bracket with two legs 40 mm long and 20 mm wide, 4 mm thick, with a 6 mm fillet on the inside of the bend. One M4 clearance hole centered across the width of each leg, 25 mm from the outside corner. Two triangular gussets 3 mm thick, one at each side edge.

Two-part enclosure for a 50 × 30 × 15 mm circuit board: 2.4 mm walls, 0.5 mm clearance around the board on every side, a lid held by four M3 screws into heat-set inserts in corner bosses, and a 12 × 7 mm USB-C cutout centered on one short wall with its bottom 4 mm above the floor.

Knob for a 6 mm D-shaft with a 4.5 mm flat: 25 mm diameter, 15 mm tall, knurled grip with 24 ridges, D-shaped bore 12 mm deep from the bottom with 0.2 mm clearance per side, 1 mm chamfer on the top edge.

Which prompt gives the CAD Agent the best chance of a part that fits first time?

  1. "A strong bracket for a shelf, with some screw holes"
  2. "A bracket like the one in a hardware store, but nicer"
  3. "An L-bracket, legs 50 mm and 30 mm, 25 mm wide, 5 mm thick, two M4 clearance holes per leg 10 mm from each end"

The third prompt gives the envelope, the thickness and every hole's size and position. The agent would have to ask questions about the first, and the second has nothing it can measure.

Turn vague words into dimensions

Instead of…Say…
"a small box""a box 60 × 40 × 25 mm outside"
"some screw holes""four M3 clearance holes, 5 mm in from each corner"
"thin walls""2 mm walls"
"rounded corners""3 mm fillets on the vertical edges"
"a lid that fits""a lid with a 3 mm lip and 0.2 mm clearance per side"
"a hole in the middle""a 10 mm through-hole at the center of the top face"
"make it stronger""walls to 3 mm and add 2 mm ribs every 20 mm"
"fits my phone""a slot 9 mm wide and 60 mm deep, angled back 15°"

Iterating on an AI CAD design

  • One change per message: "make the holes M4" is easier to follow than five edits at once.
  • Use the sliders for size changes. They're instant, exact and free of AI cost.
  • Reference features by name. Type @ in the chat to pick a feature, parameter, module or hardware part, so "@mount_hole move 2 mm outward" can't be misread.
  • Attach a photo or sketch when shape is hard to describe. The agent reads images alongside your text.
  • Go back when needed. The History drawer keeps earlier versions.

Common text-to-CAD mistakes

Mixing units: "2 inches wide with 3 mm holes". Pick millimeters and convert first (1 in = 25.4 mm).

Positions with no reference: "a hole near the edge". Say which edge and how far from it.

Nominal sizes for holes: asking for a "3 mm hole" for an M3 screw prints too tight. Ask for an "M3 clearance hole".

Asking for a sculpture: "a dragon-shaped phone stand". Generate the dragon as a mesh and the stand in CAD, then join them.

Do this: say what touches what. "The lid sits inside the walls" and "the board rests on four 3 mm standoffs" prevent most fit problems.

Exporting from the CAD Agent

  • STL (binary) and 3MF in every mode, for slicing.
  • STEP in Advanced mode, as a faceted solid: other CAD apps can open it, but curves come through as flat facets rather than true arcs.
  • OFF and the OpenSCAD source in Advanced mode. Keep the .scad file; it's the real editable design.

Combine text-to-CAD with AI meshes

Many great prints mix both: an AI-generated figure on a CAD-made base with a magnet pocket, or a CAD enclosure with a sculpted badge on the lid. Generate the mesh in the AI 3D Model Generator, build the functional part in the CAD Agent, then join and position them in your slicer. The iterating guide shows the full workflow.

AI tool · free to tryCAD AgentPaste any prompt from this page and get an editable, dimensioned partOpen tool

Frequently asked questions

What is text-to-CAD?

Text-to-CAD is AI that turns a written description of a part into a CAD model built from real dimensions. PrintPal's CAD Agent writes parametric OpenSCAD code, so you can change any measurement and the part rebuilds exactly.

How do I write a good text-to-CAD prompt?

Give the overall size in millimeters, then each feature with its size and position, the fastener or fit it needs, and what the part attaches to. Name standard parts such as 'M3 clearance hole' or 'M3 heat-set insert' instead of describing them.

What clearance should I use for 3D printed fits?

Good starting points are about 0.15 to 0.20 mm per side for a press fit and 0.25 to 0.40 mm per side for a sliding fit. Printers vary, so print a small test piece before committing to a large part.

Can AI CAD export STEP files?

PrintPal's CAD Agent exports STL and 3MF in every mode, and STEP, OFF and the OpenSCAD source in Advanced mode. The STEP is a faceted solid, so curves arrive as flat facets; keep the OpenSCAD file if you want to edit the design later.

Related articles

Sources and further reading