❯ Developer Tools · 3D · 2026
Text-to-CAD
A harness for generating source-controlled 3D models from text using coding agents on a build123d/OpenCascade Python runtime.
The problem
LLMs are good at code but bad at keeping a 3D model coherent across turns. A model generated in one shot rarely survives a follow-up like "make the neck taller", because the second generation starts from scratch or edits the wrong geometry. CAD also demands exact, reproducible artifacts: a mesh that regenerates differently is worse than none.
The approach
A text-to-CAD harness built on coding agents with a Python CAD runtime on build123d over OpenCascade. The agent writes real, source-controlled model code instead of returning a blob of geometry. The harness exports STEP, STL, DXF, GLB, and topology outputs, plus URDF robot descriptions through a bundled URDF skill. Every artifact is generated by a vendored CLI tool, so regeneration is a command, not a hope.
Architecture
- Coding Agent
- CAD + URDF Skills
- CLI Tools
- build123d Runtime
- Generated Artifacts
- CAD Explorer
FLOWS
- Coding AgentpromptsCAD + URDF Skills
- CAD + URDF SkillsinvokesCLI Tools
- CLI Toolsexecutesbuild123d Runtime
- build123d RuntimewritesGenerated Artifacts
- Generated ArtifactsloadsCAD Explorer
Vendored agent skills (CAD and URDF) expose CLI tools: gen_step_part,
gen_step_assembly, gen_urdf, cadref, and snapshot. The agent calls
these to build and preview, and @cad[...] prompt-reference handles let a
follow-up edit point at the exact part it means, with stale references
detected and flagged instead of silently applied. Generated artifacts are
checked into the repo, so a model is as reviewable as a pull request. A local
CAD Explorer (React, Three.js, Vite) renders the results, and node:test
suites cover geometry, URDF parsing and kinematics, DXF parsing, and scene
scale logic.
Key decisions
Model code, not geometry, as the output
Source-controlled parts diff, review, and regenerate.
CLI tools as the agent's only interface
The agent never improvises output formats; it runs the same commands a human would.
Prompt-reference handles for edits
Follow-ups target geometry instead of regenerating from prose.
Checked-in artifacts
A build is reproducible because the artifact and the code that made it commit together.
What I'd do differently
The viewer came after the generation harness, which made debugging geometry slow. I would ship a minimal renderer first, even a crude one, because seeing the part while iterating on the prompt loop saves more time than any export format.