Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash 99 tok/s
Gemini 2.5 Pro 48 tok/s Pro
GPT-5 Medium 40 tok/s
GPT-5 High 38 tok/s Pro
GPT-4o 101 tok/s
GPT OSS 120B 470 tok/s Pro
Kimi K2 161 tok/s Pro
2000 character limit reached

Drawing2CAD: Sequence-to-Sequence Learning for CAD Generation from Vectorized Drawings (2508.18733v1)

Published 26 Aug 2025 in cs.CV

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.

List To Do Tasks Checklist Streamline Icon: https://streamlinehq.com

Collections

Sign up for free to add this paper to one or more collections.

Summary

  • The paper presents a novel Transformer-based sequence-to-sequence framework that converts SVG vector drawings into parametric CAD command sequences.
  • It achieves high sequence accuracy (up to 92.3% on synthetic benchmarks) and ensures geometric fidelity via combined cross-entropy and consistency losses.
  • The method enables rapid design automation and reverse engineering by generating editable CAD models directly from legacy vectorized drawings.

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

Introduction

The paper presents Drawing2CAD, a sequence-to-sequence learning framework for generating parametric CAD construction sequences directly from vectorized drawings, specifically SVG representations. The approach leverages the structural similarity between SVG drawing commands and CAD construction commands, enabling a unified modeling paradigm. This work addresses the challenge of translating 2D vector graphics into editable, parametric CAD models, which is critical for downstream engineering tasks such as design automation, reverse engineering, and digital manufacturing.

Methodology

Drawing2CAD formalizes both SVG and CAD construction processes as parametric command sequences. The core architecture is a Transformer-based encoder-decoder model, where the encoder ingests the SVG command sequence and the decoder outputs the corresponding CAD command sequence. The SVG input is tokenized into a sequence of parametric commands (e.g., M, L, C for move, line, curve), each with associated geometric parameters. The output sequence consists of CAD construction commands (e.g., Line, Circle, Extrude) with their respective parameters.

The model is trained on paired SVG-CAD datasets, where each SVG drawing is annotated with its corresponding CAD construction sequence. The loss function is a combination of sequence cross-entropy and geometric consistency losses, ensuring both syntactic and semantic fidelity in the generated CAD sequence. The authors employ data augmentation strategies to improve generalization, including random perturbations of SVG parameters and command orderings.

Experimental Results

Drawing2CAD is evaluated on multiple benchmarks, including synthetic datasets and real-world engineering drawings. The model achieves high sequence accuracy (up to 92.3% on synthetic benchmarks) and geometric reconstruction fidelity, outperforming prior methods such as Free2CAD and DeepSVG in both sequence prediction and downstream CAD model editability. The ablation studies demonstrate that the geometric consistency loss significantly improves the alignment between generated CAD models and ground-truth engineering intent.

The inference speed is competitive, with average sequence generation times under 0.5 seconds per drawing on a single NVIDIA A100 GPU. The model scales linearly with input sequence length, and memory consumption remains tractable for typical engineering drawing sizes (up to 500 SVG commands).

Implementation Considerations

For practical deployment, the authors provide a modular pipeline:

  1. SVG Preprocessing: Vectorized drawings are parsed and normalized using CairoSVG and custom Python scripts.
  2. Tokenization: SVG commands are mapped to a fixed vocabulary; geometric parameters are discretized or normalized.
  3. Model Training: The Transformer model is implemented in PyTorch, with support for distributed training and mixed precision.
  4. CAD Sequence Postprocessing: Generated command sequences are validated for syntactic correctness and fed into PythonOCC or FreeCAD for 3D model instantiation.

The framework supports batch inference and can be integrated into CAD automation workflows. Limitations include sensitivity to ambiguous or poorly vectorized input drawings and the need for high-quality paired SVG-CAD datasets for optimal performance.

Theoretical and Practical Implications

Drawing2CAD advances the state-of-the-art in CAD generative modeling by bridging the gap between vector graphics and parametric CAD construction. The sequence-to-sequence paradigm enables direct learning of design intent, facilitating editable and interpretable CAD model generation. This has significant implications for design automation, enabling rapid prototyping and reverse engineering from legacy drawings.

Theoretically, the work demonstrates that command sequence modeling is effective for multi-modal translation tasks in engineering design. The unified representation of SVG and CAD commands opens avenues for cross-domain transfer learning and multi-modal generative modeling.

Future Directions

Potential future developments include:

  • Multi-modal Fusion: Integrating raster images, textual descriptions, and vector graphics for richer CAD model generation.
  • 3D CAD Sequence Generation: Extending the framework to handle 3D construction sequences from multi-view or single-view vector inputs.
  • Active Learning: Leveraging user feedback to refine sequence generation in interactive CAD environments.
  • Domain Adaptation: Adapting the model to diverse engineering domains (e.g., architecture, mechanical, electrical) with minimal retraining.

Conclusion

Drawing2CAD provides a robust, scalable solution for generating parametric CAD models from vectorized drawings via sequence-to-sequence learning. The approach achieves strong numerical results in sequence accuracy and geometric fidelity, with practical utility for engineering design automation. The unified command sequence representation and Transformer-based architecture set a foundation for future research in multi-modal CAD generative modeling and cross-domain design translation.

Ai Generate Text Spark Streamline Icon: https://streamlinehq.com

Paper Prompts

Sign up for free to create and run prompts on this paper using GPT-5.