Drawing2CAD: Sequence-to-Sequence Learning for CAD Generation from Vector Drawings
Feiwei Qin1* * Shichao Lu1* * Junhao Hou2* * Changmiao Wang3 * Meie Fang4+ * Ligang Liu5+
1Hangzhou Dianzi University 2Zhejiang University 3Shenzhen Research Institute of Big Data
4Guangzhou University 5University of Science and Technology of China
ACM Multimedia 2025
*These authors contributed equally to this work.
Installation
- Python 3.9
- Cuda 11.8+
Install python package dependencies through pip:
Dataset
Download data from here and extract them under data folder.
-
svg_rawcontains the engineering drawings of each CAD model in SVG format, including four views:Front,Top,Right, andFrontTopRight. Each SVG file has been preprocessed through path simplification and deduplication, path reordering, and viewbox normalization. To obtain engineering drawings in PNG format, you can simply convert them using CairoSVG with a single line of code:import cairosvg
cairosvg.svg2png(url=svg_path, write_to=png_path, output_width=224, output_height=224, background_color='white') -
svg_veccontains vectorized representations of SVG drawing sequences. Each file stores the stacked drawing sequences for the four views (Front,Top,Right, andFrontTopRight), saved in.npyformat to enable fast data loading. -
cad_veccontains our vectorized representation for CAD sequences, saved in.h5format to enable fast data loading.
[Update] All CAD models used in this project are sourced from DeepCAD. We have also released our pipeline and scripts here for exporting and preprocessing SVG drawings, making them available for anyone interested in converting their own CAD model data.
Training
To train the model in different input options:
Since different input options lead to different models, it is recommended to specify the experiment name using --exp_name for each run. For more configurable parameters and options, please refer to config/config.py.
Evaluation
After training the model, run the model to inference all test data:
After inference, the final results will be saved under proj/your_exp_name/test_results. To evaluate the model inference results and to export and visualize the final CAD models, please refer to the code from DeepCAD.
Acknowledgement
This repository builds upon the following awesome datasets and projects:
Cite
If you find this project useful for your research, please use the following BibTeX entry.
@article{qin2025drawing2cad,
title={Drawing2CAD: Sequence-to-Sequence Learning for CAD Generation from Vectorized Drawings},
author={Qin, Feiwei and Lu, Shichao and Hou, Junhao and Wang, Changmiao and Fang, Meie and Liu, Ligang},
journal={arXiv preprint arXiv:2508.18733},
year={2025}
}
@inproceedings{qin2025drawing2cad,
author = {Qin, Feiwei and Lu, Shichao and Hou, Junhao and Wang, Changmiao and Fang, Meie and Liu, Ligang},
title = {Drawing2CAD: Sequence-to-Sequence Learning for CAD Generation from Vector Drawings},
year = {2025},
doi = {10.1145/3746027.3755782},
booktitle = {Proceedings of the 33rd ACM International Conference on Multimedia},
pages = {10573-10582},
}