Table of Contents
Fetching ...

CAD-Recode: Reverse Engineering CAD Code from Point Clouds

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

TL;DR

CAD-Recode introduces a novel pipeline that reverses CAD models from point clouds by translating geometry into executable CadQuery Python code using a fine-tuned LLM and a lightweight point-cloud projector. The method leverages a procedurally generated 1M-sample training dataset to learn diverse, CAD-valid sketch-extrude sequences, achieving state-of-the-art accuracy on DeepCAD, Fusion360, and CC3D. The code-based representation enables direct execution, interpretability, and seamless CAD-QA and editing via off-the-shelf LLMs like GPT-4o. This work paves the way for point-cloud-to-CAD workflows that couple geometric reconstruction with programmable design exploration and natural-language interactions.

Abstract

Computer-Aided Design (CAD) models are typically constructed by sequentially drawing parametric sketches and applying CAD operations to obtain a 3D model. The problem of 3D CAD reverse engineering consists of reconstructing the sketch and CAD operation sequences from 3D representations such as point clouds. In this paper, we address this challenge through novel contributions across three levels: CAD sequence representation, network design, and training dataset. In particular, we represent CAD sketch-extrude sequences as Python code. The proposed CAD-Recode translates a point cloud into Python code that, when executed, reconstructs the CAD model. Taking advantage of the exposure of pre-trained Large Language Models (LLMs) to Python code, we leverage a relatively small LLM as a decoder for CAD-Recode and combine it with a lightweight point cloud projector. CAD-Recode is trained on a procedurally generated dataset of one million CAD sequences. CAD-Recode significantly outperforms existing methods across the DeepCAD, Fusion360 and real-world CC3D datasets. Furthermore, we show that our CAD Python code output is interpretable by off-the-shelf LLMs, enabling CAD editing and CAD-specific question answering from point clouds.

CAD-Recode: Reverse Engineering CAD Code from Point Clouds

TL;DR

CAD-Recode introduces a novel pipeline that reverses CAD models from point clouds by translating geometry into executable CadQuery Python code using a fine-tuned LLM and a lightweight point-cloud projector. The method leverages a procedurally generated 1M-sample training dataset to learn diverse, CAD-valid sketch-extrude sequences, achieving state-of-the-art accuracy on DeepCAD, Fusion360, and CC3D. The code-based representation enables direct execution, interpretability, and seamless CAD-QA and editing via off-the-shelf LLMs like GPT-4o. This work paves the way for point-cloud-to-CAD workflows that couple geometric reconstruction with programmable design exploration and natural-language interactions.

Abstract

Computer-Aided Design (CAD) models are typically constructed by sequentially drawing parametric sketches and applying CAD operations to obtain a 3D model. The problem of 3D CAD reverse engineering consists of reconstructing the sketch and CAD operation sequences from 3D representations such as point clouds. In this paper, we address this challenge through novel contributions across three levels: CAD sequence representation, network design, and training dataset. In particular, we represent CAD sketch-extrude sequences as Python code. The proposed CAD-Recode translates a point cloud into Python code that, when executed, reconstructs the CAD model. Taking advantage of the exposure of pre-trained Large Language Models (LLMs) to Python code, we leverage a relatively small LLM as a decoder for CAD-Recode and combine it with a lightweight point cloud projector. CAD-Recode is trained on a procedurally generated dataset of one million CAD sequences. CAD-Recode significantly outperforms existing methods across the DeepCAD, Fusion360 and real-world CC3D datasets. Furthermore, we show that our CAD Python code output is interpretable by off-the-shelf LLMs, enabling CAD editing and CAD-specific question answering from point clouds.

Paper Structure

This paper contains 22 sections, 2 equations, 18 figures, 7 tables.

Figures (18)

  • Figure 1: 3D CAD reverse engineering is a process of converting a point cloud into a CAD model (top). Existing methods are constrained by the use of method-specific CAD representations and limited hand-crafted training datasets (a). On the contrary, CAD-Recode employs a pre-trained LLM with a lightweight projector that translates point clouds into executable Python code and is trained on a procedurally generated dataset (b).
  • Figure 2: Sketch-extrude sequence (top) in DeepCAD representation (middle) and our CadQuery code (bottom).
  • Figure 3: Examples of procedurally generated CAD models.
  • Figure 4: Overview of CAD-Recode. The pipeline comprises two parts: (1) a point cloud projector (marked blue) (2) a fine-tuned pre-trained LLM (yellow). An input point cloud is processed using (1), and outputs are then passed to an LLM (2), which predicts a CAD sketch-extrude sequence in the form of executable Python code.
  • Figure 5: Qualitative results on the DeepCAD, Fusion360, and CC3D datasets. For each input point cloud (first row), we compare CAD models produced by CAD-SIGNet (second) and our CAD-Recode trained on our dataset (third) with a ground truth CAD model (bottom row). While CAD-SIGNet often fails to restore the general shape, CAD-Recode outputs only slightly deviate from ground truth in most cases.
  • ...and 13 more figures