CAD-Recode: Reverse Engineering CAD Code from Point Clouds

Computer-Aided Design (CAD) models are typically constructed by sequentiallydrawing parametric sketches and applying CAD operations to obtain a 3D model.The problem of 3D CAD reverse engineering consists of reconstructing the sketchand CAD operation sequences from 3D representations such as point clouds. Inthis paper, we address this challenge through novel contributions across threelevels: CAD sequence representation, network design, and dataset. Inparticular, we represent CAD sketch-extrude sequences as Python code. Theproposed CAD-Recode translates a point cloud into Python code that, whenexecuted, reconstructs the CAD model. Taking advantage of the exposure ofpre-trained Large Language Models (LLMs) to Python code, we leverage arelatively small LLM as a decoder for CAD-Recode and combine it with alightweight point cloud projector. CAD-Recode is trained solely on a proposedsynthetic dataset of one million diverse CAD sequences. CAD-Recodesignificantly outperforms existing methods across three datasets whilerequiring fewer input points. Notably, it achieves 10 times lower mean Chamferdistance than state-of-the-art methods on DeepCAD and Fusion360 datasets.Furthermore, we show that our CAD Python code output is interpretable byoff-the-shelf LLMs, enabling CAD editing and CAD-specific question answeringfrom point clouds.