arXiv:2505.06507cs.AIcs.CV2025-05被引 48

用大模型直接把文字转成可执行的CAD代码,省去中间步骤。

Text-to-CadQuery: A New Paradigm for CAD Generation with Scalable Large Model Capabilities

  • 直接生成CadQuery脚本,跳过传统中间表示转换
  • 最大模型达69.3%精确匹配,点云误差降低48.6%
  • 适合想用自然语言做3D建模的工程师和设计师

计算机辅助设计(CAD)是现代工程与制造的基础,但创建CAD模型仍需专业知识和专用软件。近年来的大语言模型(LLMs)为生成式CAD带来了可能,即直接将自然语言转化为参数化3D模型。然而,现有方法多生成任务特定的命令序列,预训练模型无法直接处理,必须转换为如CAD向量等中间表示后才能生成3D模型,这需要从头训练模型,增加复杂性。为此,我们提出直接从文本生成CadQuery代码,利用预训练大模型在Python生成和空间推理方面的优势,无需中间表示即可生成3D模型。由于这些能力随模型规模提升,我们假设更大模型经微调后表现更优。为此,我们在Text2CAD数据集上新增17万条CadQuery标注。对六种不同规模的开源大模型进行微调,结果一致提升。最佳模型达到69.3%的顶1精确匹配率(原为58.8%),点云间Chamfer Distance降低48.6%。项目页面:https://github.com/Text-to-CadQuery/Text-to-CadQuery。

原文摘要 · Abstract (English)

Computer-aided design (CAD) is fundamental to modern engineering and manufacturing, but creating CAD models still requires expert knowledge and specialized software. Recent advances in large language models (LLMs) open up the possibility of generative CAD, where natural language is directly translated into parametric 3D models. However, most existing methods generate task-specific command sequences that pretrained models cannot directly handle. These sequences must be converted into CAD representations such as CAD vectors before a 3D model can be produced, which requires training models from scratch and adds unnecessary complexity. To tackle this issue, we propose generating CadQuery code directly from text, leveraging the strengths of pretrained LLMs to produce 3D models without intermediate representations, using this Python-based scripting language. Since LLMs already excel at Python generation and spatial reasoning, fine-tuning them on Text-to-CadQuery data proves highly effective. Given that these capabilities typically improve with scale, we hypothesize that larger models will perform better after fine-tuning. To enable this, we augment the Text2CAD dataset with 170,000 CadQuery annotations. We fine-tune six open-source LLMs of varying sizes and observe consistent improvements. Our best model achieves a top-1 exact match of 69.3%, up from 58.8%, and reduces Chamfer Distance by 48.6%. Project page: https://github.com/Text-to-CadQuery/Text-to-CadQuery.

CAD生成大模型代码生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。