NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CAD-Recode: Reverse Engineering CAD Code from Point Clouds

Elona Dupont, Danila Rukhovich, Dimitrios Mallis, Anis Kacem, Kseniya Cherenkova, Djamila Aouada

TL;DR

This paper introduces CAD-Recode, a novel approach to 3D CAD reverse engineering that translates 3D point clouds directly into executable Python code representing CAD operations. By leveraging pre-trained Large Language Models (LLMs) and a procedurally generated dataset, CAD-Recode significantly outperforms existing methods and enables new possibilities for CAD editing and question-answering.

What Problem Does This Paper Address?

Creating 3D Computer-Aided Design (CAD) models is a complex and time-consuming process requiring specialized expertise. While 3D scanning offers a way to capture existing objects, converting these raw scans (often represented as point clouds) back into editable CAD models is a significant challenge. Existing methods for 3D CAD reverse engineering often rely on custom, difficult-to-interpret representations and require extensive, hand-crafted training datasets. This limits their flexibility and broad applicability. The authors aim to bridge this gap by developing a method that can reconstruct not just the final CAD model, but also the underlying design steps, in a format that is both interpretable and directly usable by CAD software.

Methods

The core innovation of CAD-Recode lies in its representation of CAD operations as Python code, specifically using the CadQuery library. This approach offers several advantages:

  • CAD Sequence Representation as Code: Instead of proprietary or custom languages, CAD-Recode uses Python scripts. This makes the output inherently interpretable and directly executable by modern CAD software that supports scripting.
  • LLM-based Decoder: The system leverages a pre-trained LLM (Qwen2-1.5B) as a decoder. This capitalizes on the LLM's existing proficiency in Python code generation.
  • Lightweight Point Cloud Projector: A dedicated module is used to process the input point cloud and convert it into learnable tokens that the LLM can understand. This projector includes furthest point sampling, Fourier positional encoding, and a linear layer.
  • Procedural Dataset Generation: To overcome the limitations of existing datasets, the authors generated a massive dataset of one million CAD sketch-extrude sequences as Python CadQuery code. This allows for fine-grained control over the features and design patterns included in training.

The overall pipeline involves a point cloud projector feeding into the LLM, which then autoregressively generates the Python code for the CAD model.

Datasets

  • Training: The paper introduces a novel, procedurally generated dataset of one million CAD sketch-extrude sequences represented as Python CadQuery code. This dataset was generated using predefined heuristics and randomized parameter selection, offering control over design features and patterns.
  • Evaluation: The model was evaluated on three existing datasets:
  • DeepCAD: A dataset of CAD models.
  • Fusion360: Another dataset of CAD models.
  • CC3D: A real-world dataset containing point clouds from actual 3D scans, which include artifacts like surface noise and missing parts.

Key Insights and Ideas

  • Python as a Universal CAD Language: Representing CAD operations as Python code is a powerful idea. It leverages the vast knowledge embedded in pre-trained LLMs about programming and makes the output directly actionable by CAD software.
  • LLMs as CAD Architects: By fine-tuning LLMs, the authors demonstrate their potential to not just generate text or code, but to understand and reconstruct complex geometric designs.
  • Procedural Generation for Data Scarcity: The success of CAD-Recode highlights the effectiveness of procedurally generating large, controlled datasets when real-world annotated data is scarce or difficult to create. This approach offers a significant advantage over relying on manually curated datasets.
  • Interpretability Opens New Doors: The Python code output is not just for reconstruction; it enables downstream tasks like CAD editing and question-answering, bridging the gap between raw 3D data and human-understandable design manipulation.

Key Results

CAD-Recode demonstrates state-of-the-art performance across multiple benchmarks:

  • Geometric Fidelity: Achieved significant improvements in Chamfer Distance (CD) metrics, with a ten-fold improvement in mean CD on the DeepCAD and Fusion360 datasets compared to existing methods.
  • Reconstruction Accuracy: Showed substantial gains in Intersection over Union (IoU), improving by over 10% on DeepCAD and Fusion360.
  • Validity: Maintained a negligibly low invalidity ratio (IR), meaning the generated code reliably produces valid CAD models.
  • Real-World Performance: On the challenging CC3D dataset, CAD-Recode achieved an 89% lower median CD and a 30% higher IoU compared to CAD-SIGNet.
  • CAD-QA: When combined with GPT-40, CAD-Recode achieved 76.5% accuracy on CAD-specific question-answering tasks, significantly outperforming baselines.

Limitations and Future Work

  • Limited Design Features: The current CAD-Recode's expressiveness is limited by the features present in the procedurally generated dataset, particularly lacking operations like revolution and fillet.
  • Future Work: The authors suggest:
  • Expanding the procedural generation to include more complex CAD features and design practices.
  • Scaling up the LLM and the dataset to handle more intricate CAD models.
  • Further exploiting the modularity of the code-based representation for more advanced editing and generation capabilities.

Summary updated

BibTeX
@inproceedings{dupont2025cad,
  author = {Elona Dupont and Danila Rukhovich and Dimitrios Mallis and Anis Kacem and Kseniya Cherenkova and Djamila Aouada},
  title = {{CAD-Recode: Reverse Engineering CAD Code from Point Clouds}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
  url = {https://openreview.net/forum?id=OHa32Dl1hb},
}
Figure