CADSmith: Multi-Agent CAD Generation with Programmatic Geometric Validation
Summary: arXiv:2603.26512v1 Announce Type: new
Abstract: Existing methods for text-to-CAD generation either operate in a single pass with no geometric verification or rely on lossy visual feedback that cannot resolve dimensional errors. We present CADSmith, a multi-agent pipeline that generates CadQuery code from natural language.
CADSmith undergoes an iterative refinement process through two nested correction loops:
- An inner loop that resolves execution errors.
- An outer loop grounded in programmatic geometric validation.
The outer loop merges exact measurements from the OpenCASCADE kernel—including bounding box dimensions, volume, and solid validity—with holistic visual assessments from an independent vision-language model named Judge. This dual approach provides both numerical precision and high-level shape awareness, enabling the system to converge on the correct geometry effectively.
One of the innovative aspects of CADSmith lies in its method of using retrieval-augmented generation over API documentation. Instead of relying on fine-tuning, CADSmith maintains a current database that evolves alongside the underlying CAD library, ensuring that the generated code remains up-to-date and robust.
Performance Evaluation
We evaluated CADSmith using a custom benchmark consisting of 100 prompts categorized into three difficulty tiers (T1 through T3) and tested across three ablation configurations. The results highlight the significant advancements CADSmith offers over traditional methods:
- Achieved a 100% execution rate, an increase from the previous 95%.
- Improved the median F1 score from 0.9707 to 0.9846.
- Enhanced the median Intersection over Union (IoU) from 0.8085 to 0.9629.
- Reduced the mean Chamfer Distance from 28.37 to 0.74.
Conclusion
These results demonstrate that closed-loop refinement, paired with programmatic geometric feedback, substantially enhances the quality and reliability of large language model (LLM)-generated CAD models. CADSmith is poised to set a new standard in CAD generation, bridging the gap between natural language and precise geometric design.
As the field of AI-driven design continues to evolve, technologies like CADSmith could revolutionize how engineers and designers create complex geometries, making the design process more efficient and accurate.
