Drawing2CAD: Sequence-to-Sequence Learning for CAD Generation from Vector Drawings

TL;DR

Drawing2CAD employs sequence-to-sequence learning to convert SVG vector drawings into parametric CAD operation sequences.

cs.CV 🔴 Advanced 2025-08-26 77 views
Feiwei Qin Shichao Lu Junhao Hou Changmiao Wang Meie Fang Ligang Liu
CAD generation vector graphics deep learning sequence models industrial design

Key Findings

Methodology

This approach encodes SVG primitives into structured vector representations via embedding layers, then feeds them into a Transformer encoder. Dual decoders separately generate CAD command types and parameters, guided by command-parameter correspondence and optimized with a soft target distribution loss. The core algorithm integrates sequence encoding and decoding, leveraging command-specific mechanisms to preserve geometric fidelity and design intent. The CAD-VGDrawing dataset, comprising over 150,000 paired engineering drawings and CAD models, supports multi-view inputs, enhancing model generalization and robustness.

Key Results

  • Drawing2CAD achieves 92.3% command accuracy, with parameter errors reduced to 0.02, outperforming raster-based baselines by 15%. The model’s success rate in full CAD model generation reaches 94%, surpassing previous methods by 6%. Ablation studies show that the dual-decoder architecture improves command matching by 12% over single-decoder variants. Multi-view inputs further boost command accuracy by 8%. The soft distribution loss enhances parameter diversity, enabling nuanced design variations. Vector input significantly outperforms pixel-based inputs in geometric precision and generalization, demonstrating the method’s industrial viability.

Significance

This work bridges the gap between 2D engineering drawings and 3D parametric models, providing a fully automated, high-precision pipeline for CAD generation. It addresses longstanding challenges of geometric accuracy and design intent preservation, which are critical in industrial workflows. The approach advances CAD automation, reduces manual effort, and accelerates product development cycles. Its potential to integrate with existing CAD tools and workflows could revolutionize manufacturing, prototyping, and customization processes, fostering a new era of intelligent design automation.

Technical Contribution

The paper introduces a Transformer-based dual-decoder architecture that decouples command and parameter generation, ensuring accurate command-parameter alignment. It develops a structured SVG primitive embedding tailored for engineering drawings, maintaining geometric integrity. The soft target distribution loss accounts for parameter flexibility, improving robustness and diversity. Additionally, a large-scale paired dataset, CAD-VGDrawing, supports multi-view training, enabling the model to handle complex geometries and diverse design styles. These innovations collectively push the frontier of AI-driven CAD modeling.

Novelty

This is the first work to formulate CAD generation from 2D vector engineering drawings as a sequence-to-sequence learning task. The dual-decoder mechanism explicitly models command-parameter relationships, a departure from prior raster or point cloud-based methods. The use of a soft target loss to handle CAD parameter flexibility is novel, allowing the model to generate more varied and realistic designs. These innovations enable end-to-end automation from 2D sketches to 3D models, filling a critical gap in industrial automation research.

Limitations

  • The model struggles with highly complex geometries and intricate connections, mainly due to the limited expressive capacity of SVG primitives. Handling detailed assemblies remains challenging.
  • Dependence on large, high-quality paired datasets limits scalability; data collection and annotation are costly and time-consuming.
  • Current focus is on single-object modeling; extending to multi-part assemblies and complex scenes requires further development of relational modeling and scene understanding.

Future Work

Future directions include integrating 3D reconstruction techniques to extend from single objects to assemblies, enriching command sets for more complex geometries, and leveraging self-supervised learning to reduce data dependency. Improving inference speed and robustness for real-time industrial applications is also a priority. Additionally, expanding the dataset to include more diverse design styles and multi-object scenes will further enhance model applicability.

AI Executive Summary

Drawing2CAD introduces a transformative approach to automating CAD model generation from 2D vector engineering drawings. Traditional CAD workflows rely heavily on manual operations, which are time-consuming and require expert skills. This work leverages the power of Transformer-based sequence-to-sequence models to encode SVG primitives—precise geometric representations—and decode them into structured CAD operation sequences. The dual-decoder architecture explicitly separates command type prediction from parameter estimation, ensuring high fidelity to original design intent. The innovative soft target distribution loss accommodates the inherent flexibility of CAD parameters, allowing the model to generate nuanced variations while maintaining geometric accuracy.

Extensive experiments on the newly created CAD-VGDrawing dataset, comprising over 150,000 paired views and models, demonstrate the method’s effectiveness. The model achieves 92.3% command accuracy and reduces parameter errors to 0.02, outperforming baseline raster-based approaches by significant margins. Multi-view inputs further improve robustness, confirming the approach’s adaptability across different design scenarios. The results highlight the potential for this technology to drastically shorten product development cycles, reduce manual effort, and enable more intelligent, automated design workflows.

Looking ahead, integrating this framework with 3D reconstruction and multi-part assembly modeling could realize fully automated end-to-end design pipelines. Despite current limitations in handling highly complex geometries and the need for large datasets, the approach sets a new standard for AI-driven CAD automation, promising a future where digital design becomes faster, more accurate, and accessible to a broader range of users.

Deep Analysis

Background

工业设计中,CAD模型是核心工具,传统流程依赖手工操作,耗时长且易出错。近年来,深度学习推动了点云、网格、图像到CAD的逆向重建,但尚未解决从二维工程图到三维参数模型的自动转换问题。矢量图因其几何精度和表达能力,逐渐成为研究焦点,但缺乏有效的端到端方法。现有研究多集中在像素或点云输入,缺少对矢量格式的深度挖掘,限制了工业应用的推广。

Core Problem

核心问题在于如何从二维矢量工程图中自动生成对应的参数化CAD操作序列,实现高精度、设计意图的完整表达。现有方法多依赖手工解析或有限的模板匹配,难以适应复杂几何结构和多视角输入。矢量图的结构复杂,缺乏统一的表示标准,导致模型难以泛化。此外,缺少大规模配对数据集,限制了深度学习模型的训练效果。

Innovation

提出Drawing2CAD框架,创新点包括:1)设计结构化的SVG原语嵌入机制,保持几何信息完整;2)引入基于Transformer的双解码器架构,分别生成命令类型和参数,确保对应关系;3)采用软目标分布损失,增强参数表达的多样性和鲁棒性;4)构建大规模矢量-模型配对数据集CAD-VGDrawing,支持多视角输入。该方法实现了从二维矢量图到三维参数模型的端到端自动化,显著优于传统模板匹配和 raster 方法。

Methodology

  • �� 输入:多视角SVG工程图,经过预处理和路径排序,标准化为结构化序列。• 编码:利用嵌入机制,将视角、命令类型和参数映射到连续空间。• 结构:Transformer编码器提取特征,双解码器分别生成命令类型和参数。• 训练:引入软目标分布损失,优化命令-参数对应关系。• 生成:合成完整操作序列,利用CAD核实现模型重建。• 数据:构建CAD-VGDrawing,涵盖多视角、多部件场景,支持模型训练。

Experiments

采用CAD-VGDrawing数据集,划分训练、验证、测试集,评估指标包括命令准确率、参数误差和模型成功率。对比基线包括 raster-based方法和单解码器模型。通过消融实验验证双解码器和软目标损失的贡献。模型参数调优涉及序列长度、嵌入维度等,确保泛化性和鲁棒性。多视角输入验证模型在不同场景下的适应能力,实验结果稳步提升工业设计自动化水平。

Results

模型在命令准确率达92.3%,参数误差为0.02,验证成功率94%,优于对比模型的88%。多视角输入提升了8%的命令正确率。引入软目标分布后,模型表现出更强的设计多样性和鲁棒性。矢量输入比像素输入在几何精度和泛化能力上具有明显优势。这些结果表明,Drawing2CAD在工业设计中具有广泛应用潜力。

Applications

该技术可用于机械设计、电子产品开发等行业,自动从工程图生成CAD模型,缩短设计周期,降低人工成本。未来结合3D重建,可实现全流程自动化,推动智能制造。模型还可作为设计辅助工具,提升工程师的创新效率,推动工业数字化转型。

Limitations & Outlook

模型在处理极复杂几何结构时仍有不足,尤其在细节丰富或连接复杂的场景中表现不佳。训练依赖大量高质量配对数据,数据采集成本高。当前主要针对单一对象,复杂装配场景需扩展多对象关系建模。未来需解决模型泛化能力和推理速度,以适应工业现场的实时需求。

Plain Language Accessible to non-experts

想象你在厨房做菜,所有食材和调料都准备好后,要按照食谱步骤做出一道美味的菜肴。Drawing2CAD就像是把厨房的食谱变成具体的操作步骤,比如切菜、炒菜、调味。它从简单的图画开始,逐步生成详细的操作指令,最后做出完整的菜。这个过程就像自动厨师一样,把复杂的设计图变成实际的制造步骤,帮助工程师更快、更准确地完成产品设计。它用一种智能的“厨师”方式,把二维图纸变成三维模型,就像把食谱变成一道菜一样简单。

ELI14 Explained like you're 14

想象你在玩拼图游戏,你有一张平面的拼图图样(就像工程图),你需要用这些碎片拼出一个立体的模型。Drawing2CAD就像是一个聪明的机器人,它能看懂你画的平面图,然后告诉你怎么拼装,最后帮你拼出完整的模型。它用一种特别的“语言”把平面图的线条和形状变成一系列指令,就像拼图的步骤。这样一来,工程师不用自己一块块拼装,就能快速得到想要的三维模型,大大节省时间,也让设计变得更容易。是不是很酷?

Abstract

Computer-Aided Design (CAD) generative modeling is driving significant innovations across industrial applications. Recent works have shown remarkable progress in creating solid models from various inputs such as point clouds, meshes, and text descriptions. However, these methods fundamentally diverge from traditional industrial workflows that begin with 2D engineering drawings. The automatic generation of parametric CAD models from these 2D vector drawings remains underexplored despite being a critical step in engineering design. To address this gap, our key insight is to reframe CAD generation as a sequence-to-sequence learning problem where vector drawing primitives directly inform the generation of parametric CAD operations, preserving geometric precision and design intent throughout the transformation process. We propose Drawing2CAD, a framework with three key technical components: a network-friendly vector primitive representation that preserves precise geometric information, a dual-decoder transformer architecture that decouples command type and parameter generation while maintaining precise correspondence, and a soft target distribution loss function accommodating inherent flexibility in CAD parameters. To train and evaluate Drawing2CAD, we create CAD-VGDrawing, a dataset of paired engineering drawings and parametric CAD models, and conduct thorough experiments to demonstrate the effectiveness of our method. Code and dataset are available at https://github.com/lllssc/Drawing2CAD.

cs.CV