Large language models have recently enabled text-to-CAD systems that synthesize parametric CAD programs (e.g., CadQuery) from natural-language prompts. In practice, however, geometric descriptions can be under-specified or internally inconsistent: critical dimensions may be missing and constraints may conflict. However, existing fine-tuned models tend to reactively follow the user instructions and hallucinate dimensions when the text is ambiguous. To address this, we propose a proactive agentic framework for text-to-CadQuery generation, named as ProCAD, that resolves specification issues before code synthesis. Our framework pairs a proactive clarifying agent, which audits the prompt and asks targeted clarification questions only when necessary to produce a self-consistent specification, with a CAD coding agent that translates the specification into an executable CadQuery program. We fine-tune the coding agent based on a curated high-quality text-to-CadQuery dataset and train the clarifying agent via agentic SFT on clarification trajectories. Experiments show that proactive clarification significantly improves robustness to ambiguous prompts while keeping interaction overhead low. ProCAD outperforms frontier closed-source models, including Claude Sonnet 4.5, reducing the mean Chamfer distance by 79.9% and lowering the invalidity ratio from 4.8% to 0.9%. Our code and datasets are made publicly available on https://github.com/BoYuanVisionary/Pro-CAD.
翻译:大语言模型最近使得文本到CAD系统成为可能,这类系统能从自然语言提示合成参数化CAD程序(例如CadQuery)。然而在实践中,几何描述往往存在欠指定或内部不一致的问题:关键尺寸可能缺失,约束条件可能冲突。现有的微调模型倾向于被动遵循用户指令,并在文本模糊时臆测尺寸。为解决这一问题,我们提出了一种面向文本到CadQuery生成的主动式智能体框架,命名为ProCAD,该框架在代码合成前解决规格问题。我们的框架将主动式澄清智能体与CAD编码智能体配对:前者审查提示并仅在必要时提出针对性澄清问题以生成自洽的规格,后者将规格转换为可执行的CadQuery程序。我们基于精心策划的高质量文本到CadQuery数据集微调编码智能体,并通过在澄清轨迹上进行主动式监督微调训练澄清智能体。实验表明,主动式澄清显著提升了系统对模糊提示的鲁棒性,同时保持了较低的交互开销。ProCAD超越了包括Claude Sonnet 4.5在内的前沿闭源模型,将平均倒角距离降低了79.9%,并将无效率从4.8%降至0.9%。我们的代码和数据集已在https://github.com/BoYuanVisionary/Pro-CAD上公开。