Why OpenSCAD is the perfect language for an AI to write CAD in
Of all CAD formats, OpenSCAD is the one language models write best. Text, declarative, parametric, deterministic. Here is why SpeakCAD chose it and what it means for you.Large language models write text
An LLM predicts tokens. It is at its best producing structured text it has seen a lot of: code. Traditional CAD stores models as binary feature trees (Fusion, SolidWorks) or as B-rep kernels behind a GUI. There is nothing for a language model to write. OpenSCAD is the opposite: a small, declarative, text-based language with thirty years of examples on the web.
Declarative and compositional
An OpenSCAD program says what the shape is, not how to click to get it:
javascriptdifference() {cube([60, 40, 20], center = true);cylinder(d = 6.4, h = 30, center = true);}
The AI can reason about that the way it reasons about any code: compose modules, factor parameters, name things. Edits are local and predictable.
Deterministic compilation
The same program always produces the same mesh. That property is what lets SpeakCAD offer a fair credit rule: we can compare two versions of a design objectively (code similarity, volume, bounding box) and decide whether an edit is a small fix or a new part.
Fast enough for the browser
The modern OpenSCAD builds use the Manifold geometry kernel, which turned minutes-long renders into sub-second ones. Compiled to WebAssembly, the whole engine runs in a browser tab. There is no server rendering, no GPU cost, no queue, and your model never has to leave your machine to be previewed.
Where OpenSCAD falls short, and how we handle it
- No fillets primitive. The AI builds fillets with hulls of cylinders and spheres, or with 2D offsets before extruding.
- No libraries in the browser. BOSL2 and MCAD are not available, so the system prompt forbids them and the AI writes its own small helpers.
- Rendering cost of minkowski(). We steer the AI away from it on complex shapes.
- Fonts. Only a default font ships in the WASM build, so text is kept simple.
The bonus: you get the code
Every SpeakCAD model is readable OpenSCAD. View it in the app, copy it into the desktop tool, version it, share it. If you already write OpenSCAD, upload your .scad and let the AI do the boring edits.
