Why We Separated LLM Parsing from OpenCascade Geometry Compilation for Text-to-CAD
Most AI 3D generators today output neural triangle meshes (GLB/OBJ). They work well for figurines and game assets, but they break down as soon as you need an M5 clearance hole spaced 80 mm apart or an involute spur gear
Most AI 3D generators today output neural triangle meshes (GLB/OBJ). They work well for figurines and game assets, but they break down as soon as you need an M5 clearance hole spaced 80 mm apart or an involute spur gear that actually meshes.
When building Cad Bot, we took a stricter architecture: the LLM never touches vertices or triangles.
The Two-Stage Deterministic Pipeline
- Semantic parsing (LLM -> strict JSON DSL): The model reads a plain-English part prompt (for example, "slotted mounting plate 100x60x5 mm, 4x M5 clearance holes 80x40 apart, corners rounded r3") and maps it onto a typed part schema.
-
Deterministic compilation (CadQuery / OpenCascade): A Python geometry container compiles that JSON specification into a real B-rep solid, verifies watertightness and minimum wall thickness (0.8 mm), and exports:
- STL for 3D printing
- STEP (ISO 10303) for editing in Fusion 360, SolidWorks, or FreeCAD
- ISO A4 3-view shop drawings in DXF, AutoCAD R2000 DWG, SVG, and PDF
Because numbers pass straight from the prompt into the OpenCascade kernel, stated dimensions are exact by constructionβand post-generation dimension sliders recompile the solid deterministically without calling the LLM again.
Choosing the Right Export Format
If you are deciding between meshes and parametric solids for functional prints or CNC machining, we wrote a short reference comparing STL vs STEP vs 3MF:
- STL: Universal for slicers when dimensions are final.
- STEP: Keeps exact cylinders and flat faces for CAD edits and CAM toolpaths.
- 3MF: Compact mesh package with explicit units and multi-material metadata.
Try It or Inspect the Scope
We also maintain dedicated pages for AI CAD generator workflows and an involute spur gear generator. Out-of-scope geometry (like helical/bevel gears or multi-part assemblies) is refused explicitly rather than approximated.
Curious how others are combining LLMs with deterministic CAD kernels (CadQuery, OpenSCAD, Replicad)βhappy to discuss tradeoffs in the comments.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.