query2cad-freecad
Query2CAD: natural language → FreeCAD macro with self-refinement
Paper: A. Badagabettu, S. S. Yarlagadda, A. Barati Farimani, Query2CAD: Generating CAD models using natural language queries, arXiv:2406.00144 (code: github.com/akshay140601/Query2CAD). With GPT-4 Turbo, success went from 53.6% on the first try to 73.2% after one refinement and 76.7% after three (easy 95%, medium 70%, hard 42%). Most of the gain comes from the first refinement, and most failures (69%) were macros that never executed.
When to prefer the alternatives: CADSmith (cadsmith-text-to-cad) gives kernel-checked dimensional accuracy in CadQuery. Use Query2CAD when the user lives in FreeCAD, wants a .FCMacro, or the query is conceptual ("a basketball hoop", "a bookshelf") rather than dimension-exact.
Requires FreeCAD with freecadcmd on PATH, or FREECAD_CMD set. Tested headless with FreeCAD 26.3 from conda-forge: micromamba create -p ./fc -c conda-forge freecad python=3.11, then export FREECAD_CMD=./fc/bin/freecadcmd. The AppImage and Homebrew builds also work. Rendering uses pyvista. VQAScore optionally uses pip install t2v-metrics. Q = scripts/q2c.py.