Blog · · 4 min read

CAD as code: why AI writes the 3D model instead of drawing it

Why an AI that builds hardware should write parametric CAD scripts instead of clicking in a CAD window, what that gives you (exact dimensions, versions, STEP files) and where it still struggles.

When people imagine an AI designing a physical product, they often picture it "drawing" a part, the way an image generator paints a picture. That is not how useful mechanical design works, and it is not how we do it on makemachine.ai. Our approach is simpler and a little old-fashioned: the AI writes the model as code.

This article explains what "CAD as code" means, why it fits language models so well, and where its limits are.

What CAD as code is

In a classic CAD program you sketch a rectangle, click "extrude", pick an edge and add a fillet. The result is stored as a history of mouse operations inside a proprietary file.

In code-based CAD, the same part is a short script that describes the solids. Behind it sits a boundary-representation (B-rep) geometry kernel, the same kind of kernel that engineering CAD tools use. That means real solids with exact faces and edges, not a mesh of triangles, and export to STEP, the format every serious CAD system and machine shop understands.

A bracket might look like this in spirit:

  • a base plate of 80 × 40 × 4 mm,
  • two holes of 5.5 mm for M5 screws, 60 mm apart,
  • a vertical wall with a 3 mm fillet where it meets the plate.

Change "4 mm" to "5 mm" and run the script again: you get a new, consistent part. That is parametric design without a GUI.

Why it suits language models

Language models are good at reading and writing structured text. They are poor at precise mouse work and have no reliable sense of "a bit more to the left". CAD as code turns mechanical design into exactly the kind of task they handle well:

  1. Dimensions are explicit. A wall is 3 mm because the script says 3, not because a cursor stopped somewhere.
  2. Intent is readable. Names like screw_spacing or wall_thickness explain why a number exists. A reviewer, human or AI, can check the reasoning, not just the shape.
  3. Every version is a diff. You can see exactly what changed between version 1.2 and 1.3 of a part. Nothing is hidden in a binary file.
  4. Checks can be automated. The same script can compute volume, mass, bounding box or the gap between two parts and fail loudly if a rule is broken.
  5. Outputs are standard. STEP for engineering, STL or 3MF for 3D printing, rendered images for the presentation, all from one source.

On makemachine.ai this means the mechanical CAD module produces a script, the model, renders and a short report, and the next module (for example a strength check or a parts list) can read the same numbers instead of guessing them from a picture.

What it looks like in practice

You can follow this on our public projects. The BBQ Modular Grill went from concept to a mechanical model with legs, shelf, lid and handles; the Jump & Run Robot and Go FANUC Go show how a model grows over several versions. Each version is a new run of code, so you can compare them side by side.

A typical loop looks like this:

  1. Read the concept and the requirements (size, load, materials, how it will be made).
  2. Write the model as code, part by part, with named parameters.
  3. Render it from several angles and look at the pictures critically: does the lid clear the handle, do the legs reach the floor, is anything floating?
  4. Fix, re-run, and only then export the files.

Step 3 matters. A script that runs without errors is not yet a good design.

Where it struggles

CAD as code is not magic, and pretending otherwise would be dishonest.

  • Organic and styled shapes are hard. Smooth consumer-product surfaces, ergonomic grips or car-body curves are much easier to shape by hand in a surface modeller than to describe in code.
  • Spatial mistakes still happen. A model can place a hole on the wrong face or let two parts overlap. Renders, section views and automated interference checks catch most of this, but a human review before manufacturing is still essential.
  • Geometry kernels have opinions. Fillets that are too large, very thin walls or tangent faces can make the kernel fail. Good scripts build in steps and test each one.
  • Code is not a drawing. Workshops often want 2D drawings with tolerances. These can be generated, but they need care and a clear idea of which dimensions really matter.
  • Physics is a separate question. A beautiful model can still be too weak. That is what simulation and real tests are for.

Why we think it is the right default

The goal of makemachine.ai is to take an idea all the way to something you can build: concept, research, CAD, electronics, simulation, sourcing and a presentation. For that chain to work, each step has to hand clean, checkable data to the next one. A parametric script is exactly that kind of hand-over. It is precise, it can be reviewed, it can be changed in seconds, and it produces files that existing tools and manufacturers already accept.

The interesting work is still in the judgement: which constraints matter, what can be bought instead of designed, what is safe to print and what needs metal. Code-based CAD does not replace that judgement. It makes it visible.

If you want to see the process live, open the projects on makemachine.ai, follow one that interests you and watch the next version appear.

Watch hardware get built by AI. Follow public projects on makemachine.ai, read every result in full and get an email when there is something new.

Get started See the live projects

More from the blog

Open-hardware projects built with AI