Drawing2CAD: Automated Vector-to-CAD Conversion
- Drawing2CAD is a framework that transforms 2D vector drawings into precise, editable CAD models by decomposing drawings into tokenized geometric primitives.
- The system employs a dual-decoder transformer architecture that separately predicts discrete CAD commands and continuous parameters to maintain geometric fidelity.
- The approach integrates a soft target distribution loss and the CAD-VGDrawing dataset to enhance reconstruction accuracy and support industrial CAD automation.
Drawing2CAD is a computational framework focused on the transformation of 2D vector drawings—such as those produced in traditional engineering design—into editable, parametric Computer-Aided Design (CAD) models. This approach bridges a key gap in CAD automation by moving beyond generative modeling from point clouds, meshes, or natural language, aligning more closely with established industrial workflows. The Drawing2CAD paradigm reframes the CAD generation process as a sequence-to-sequence learning problem, structuring the transition from vector graphics primitives to executable, parameterized CAD operations while ensuring preservation of geometric fidelity and engineering intent (Qin et al., 26 Aug 2025).
1. Vector Primitive-Based Representation
The Drawing2CAD workflow commences by systematically decomposing input vector drawings into a sequence of geometric primitives such as lines, arcs, circles, and related parametric entities. This is encapsulated in a “network-friendly” representation, where each primitive is tokenized into a format amenable to neural network ingestion. For instance, each vector entity is encoded with:
- The command type (e.g., 'LINE', 'ARC')
- A contiguous set of parameters (e.g., endpoints, radius, center)
- Hierarchical structure and command ordering
- Associated properties (e.g., layer, color if relevant to downstream applications)
The explicit, structured encoding ensures that each geometric entity retains its parametric integrity throughout the pipeline. Such representations typically generalize well across drawing standards and are essential for precise downstream reconstruction.
2. Dual-Decoder Transformer Architecture
At the core of Drawing2CAD is a sequence-to-sequence transformer network with a dual-decoder configuration. The architecture consists of:
- Encoder: Processes the input sequence of tokenized vector primitives, learning a contextual latent representation that encodes both the structure and parameterization of the drawing.
- Command Decoder: Predicts the high-level CAD operation for each step (for example, 'EXTRUDE', 'FILLET', 'ADD-CIRCLE'), reconstructing the operation plan needed to build the parametric model.
- Parameter Decoder: Independently predicts the continuous parameters (coordinates, radii, angles, etc.) required for each corresponding command.
This dual-decoder arrangement decouples discrete command inference from continuous parameter regression, enabling accurate semantic and geometric modeling. The explicit mapping between drawing primitives and CAD commands ensures that design intent, geometric constraints, and operation order are preserved.
3. Soft Target Distribution Loss
Drawing2CAD introduces a soft target distribution loss function in its training regime to manage inevitable ambiguities inherent in mapping noisy or overspecified drawings to CAD command sequences. Formally, for each decoder time step :
where is a soft (probabilistic) target over plausible tokens, rather than a single one-hot label. This loss assignment allows the model to learn from multiple correct or near-correct command/parameter combinations, handling cases where different command sequences can recreate identical geometry, or when the original drawing exhibits variations permissible within engineering tolerances. The approach yields smoother optimization and greater robustness against minor annotation inconsistencies or interpretative flexibility in engineering drawings.
4. Dataset: CAD-VGDrawing
To support effective training and benchmarking, the CAD-VGDrawing dataset was constructed expressly for the Drawing2CAD framework. This dataset provides:
- Synchronized pairs of vectorized engineering drawings (e.g., in SVG or similar vector format) and their corresponding, fully specified CAD command sequences.
- Wide coverage of drawing styles, command types, and geometric complexity.
- Comprehensive annotation to allow for quantitative analysis of both semantic and geometric reconstruction accuracy.
This resource facilitates direct training of models as well as rigorous ablation and comparative evaluation, presenting a new standard for CAD-generation studies that target the engineering drawing modality.
5. Experimental Results and Ablations
Extensive experiments on CAD-VGDrawing and additional benchmarks demonstrate Drawing2CAD’s superiority over prior approaches in several respects:
- Command Prediction Accuracy: The framework yields higher accuracy in reconstructing the correct sequence of CAD operations from vectorized input.
- Geometric Error Metrics: Reconstruction fidelity, as quantified by metrics akin to Chamfer distance and parameter error, is markedly improved, affirming precise spatial alignment.
- Sequence Similarity and Interpretability: The generated CAD command sequences closely align with reference solutions, facilitating interpretability and downstream editing.
- Ablation Studies: Empirical analysis confirms that the network-friendly vector representation, dual-decoder architecture, and soft target loss each contribute to improved convergence, accuracy, and robustness.
6. Applications and Implications
Drawing2CAD has substantive implications for industry and academia:
- CAD Automation: By automating the translation of 2D engineering drawings into parametric CAD models, Drawing2CAD minimizes the need for manual feature reconstruction, supporting both legacy digitization and design iteration pipelines.
- Reverse Engineering: The framework is well-suited for reconstructing CAD models from historical documentation, especially where vectorized drawings exist but original parametric models are absent.
- Design Interoperability and Lifecycle Integration: Command sequence outputs facilitate sharing, simulation, and optimization, integrating with heterogeneous engineering and simulation environments throughout the product lifecycle.
A plausible implication is that this model’s structured, token-based approach could serve as a blueprint for future CAD automation systems seeking interoperability and auditability, as command sequences are inherently more transparent and modifiable than low-level mesh or voxel outputs.
7. Open-Source Release and Community Adoption
The Drawing2CAD authors have made both the implementation and the CAD-VGDrawing dataset publicly available via GitHub, promoting transparency, reproducibility, and collaborative advancement in the space of vector-to-CAD model automation. Open access to the codebase—including transformer architecture details, dataset preparation scripts, and evaluation tools—supports rapid adoption and adaptation in both research and industrial contexts (Qin et al., 26 Aug 2025).
Drawing2CAD thus provides a principled, modular, and empirically validated strategy for automating the conversion of vector graphics engineering drawings to editable, parametric CAD models. Through innovations in representation, model architecture, and loss design, the approach advances the fidelity and practicality of engineering drawing–driven CAD generation.