StepCAD: Mesh-to-CAD Code Generation via LLM Policy and Geometry-Guided Search

Ghadi Nehme, Faez AhmedNeurIPS 2026

TL;DR

Think of a 3D mesh—whether from a physical scan or an AI generator—as a baked cake: you can see its exact shape, but you have no idea what recipe made it, making it notoriously difficult to tweak for real-world engineering. StepCAD reverse-engineers that recipe into editable, executable CAD code by pairing a step-by-step, geometry-aware language model with a local tree search that fine-tunes dimensions. Backed by a massive new synthetic dataset of complex operations, it dramatically outperforms prior methods, especially when shapes get weird and intricate.

What Problem Does This Paper Address?

Modern engineering relies on parametric Computer-Aided Design (CAD)—structured sequences of exact operations (like "draw a 12mm circle, extrude it 8mm, round the top edge"). However, 3D scanners, topology optimizers, and generative AI spit out unstructured 3D meshes: dense clouds of triangles that you can't easily edit or manufacture.

Turning a "dumb" mesh into "smart" CAD code is like trying to write a long Python script to draw a complex sculpture without ever looking at the screen while you type. Most existing AI approaches do exactly this: they look at the target 3D shape once and try to spit out the entire CAD program in a single pass. Worse, they mostly rely on basic "sketch-and-extrude" commands. If the model misjudges an early angle or needs a smooth, curved transition, errors compound, and there is no built-in way to fix the geometry mid-flight.

Methods

Instead of treating CAD generation as one-shot translation, the authors split the problem into two intuitive stages: drafting with visual feedback, followed by polishing via explicit search.

StepCAD's closed-loop policy conditions on both the target shape and the evolving intermediate 3D state.
  1. State-Conditioned Policy ($\Pi$-StepCAD): Built on a 1.5B-parameter coding LLM (Qwen2.5-Coder) paired with a Point-MAE 3D encoder, this model writes CadQuery (Python) code one construction step at a time. Crucially, it operates in a closed loop: after predicting an action, it actually executes the code, samples a point cloud of the intermediate 3D solid it just built, and looks at both its current progress and the target mesh before deciding what to do next.
  2. Geometry-Aware Program Optimization: LLMs are great at high-level structure, but bad at guessing exact floating-point numbers. Taking the policy's draft program as a seed, StepCAD runs a beam search (beam width $K=2$) guided by volumetric overlap—specifically, Intersection-over-Union (IoU) with the target mesh. At each step, it tests four local code edits:
  3. Continuous refinement: Tweaking numbers (depths, radii) via Bayesian optimization.
  4. Sketch modification: Slicing the target mesh at the active workplane to extract a cleaner 2D profile.
  5. Complement cut: Automatically carving away regions where the generated solid overshoots the target.
  6. Operation skipping: Deleting steps that do more harm than good.

Datasets

To train a model that understands intermediate steps and diverse tools, the authors had to build ARCADE-1.5M, a synthetic dataset of 1.5 million executable CadQuery scripts. Unlike older staples like DeepCAD or Fusion 360—which stick almost exclusively to basic extrusions—ARCADE-1.5M uses 94 heuristic strategies to compose complex, valid single-body solids up to 150+ counted operations long. It includes revolves, sweeps, lofts, shells, fillets, and chamfers, and saves the intermediate 3D state after every solid operation, yielding 12.5 million state-action transitions.

ARCADE-1.5M synthesizes diverse, multi-step CAD models using a rich vocabulary of solid operations.

For evaluation, the team tested on CADBench, an aggregate benchmark spanning structured CAD parts (DeepCAD, Fusion 360, ABC split into Easy/Medium/Hard), mechanical components (MCB), and free-form organic shapes (Objaverse).

Key Insights and Ideas

  • Looking at your work beats blind memorization: Even without the final search stage, the step-by-step policy ($\Pi$-StepCAD) beats prior state-of-the-art methods on tough shapes. Conditioning on intermediate geometry keeps long sequences from derailing.
  • Search is a plug-and-play superpower: Explicit program search isn't just a crutch for StepCAD; when the authors applied their geometry-guided tree search directly to outputs from a competing baseline (CAD-Recode) without any retraining, mean IoU jumped from 0.597 to 0.745.
  • A richer vocabulary unlocks organic shapes: Because ARCADE-1.5M heavily features non-extrude operations (like sweeps in ~25% of scripts), StepCAD actually uses them. On organic shapes, StepCAD uses loft in 30.4% of its programs (vs. 3.0% for CADEvolve), allowing it to capture smooth, curved transitions instead of approximating them with blocky staircases.
  • One shape, many valid recipes: Sampling from the policy reveals that it learns a genuine distribution over construction strategies—building the exact same 3D geometry via completely different, equally valid sequences of cuts and unions.

Key Results

StepCAD achieves state-of-the-art results across every split of CADBench on volumetric overlap (IoU), surface accuracy (Chamfer Distance), and Valid Shape Rate (VSR):

  • Massive gains on complex geometry: On ABC Hard, StepCAD hits 0.73 IoU, an 87.2% relative improvement over the best prior baseline (0.39 IoU). On ABC Medium, it jumps from 0.43 to 0.74 IoU (+72.1%).
  • Cross-domain robustness: On Mechanical and Organic shapes, it reaches 0.89 (+32.8%) and 0.71 IoU (+69.0%), respectively, while reducing Chamfer Distance by up to 27.8%.
  • Near-perfect executability: Because both the closed-loop policy and search verify execution, VSR sits at 99.95%–100% across all benchmarks.
  • Ablation clarity: Across controlled tests, moving from a single-shot baseline trained on ARCADE-1.5M (0.644 IoU) to intermediate-state conditioning bumps IoU to 0.682, and adding tree search vaults it to 0.816.

Limitations and Future Work

  • Inference speed: Executing CAD kernels inside a tree search isn't free—refining a single shape takes roughly one minute, and the policy is capped at 12 high-level construction actions.
  • Geometry $\neq$ Design Intent: StepCAD optimizes for shape overlap (IoU), not engineering semantics. For instance, if a fillet (rounded edge) has slightly the wrong radius, the search might just skip it to boost IoU rather than preserve the designer's intent.
  • Coarse entity selection: The system uses broad directional selectors rather than clicking specific B-rep faces or edges, limiting surgical edits. Future work aims to blend point clouds with exact boundary representations (B-reps), speed up search, and incorporate engineering constraints.

Summary updated

Abstract

Recovering executable CAD programs from 3D meshes is fundamentally challenging due to the long-horizon, compositional nature of CAD construction and the need for precise estimation of both discrete operations and continuous parameters. Existing learning-based methods primarily treat mesh-to-CAD reconstruction as one-shot sequence prediction and are largely limited to simple sketch-extrude pipelines, restricting operation diversity and preventing the use of intermediate geometric feedback, with no mechanism for refining generated programs. To address this limitation, we introduce StepCAD, a generative optimization approach that performs step-by-step, geometry-conditioned program synthesis followed by explicit refinement in program space. Given an input mesh, StepCAD first predicts construction sequences using a state-conditioned CAD policy conditioned on both target and intermediate geometry, then refines them through IoU-guided tree search over local program edits. To address the limited operation diversity in prior work, we further introduce ARCADE-1.5M, a large-scale dataset of 1.5M executable CAD programs with diverse operations, long-horizon sequences up to 150+ operations, and 12.5M intermediate state-action transitions. Experiments on multiple CAD reconstruction benchmarks show that StepCAD achieves state-of-the-art reconstruction accuracy, validity, and robustness, with up to 87.2\% relative IoU improvement over the best prior method and increasingly larger gains as shape complexity increases.
BibTeX
@inproceedings{nehme2026stepcad,
  author = {Ghadi Nehme and Faez Ahmed},
  title = {{StepCAD: Mesh-to-CAD Code Generation via LLM Policy and Geometry-Guided Search}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=oLvC2AljNY},
}
Figure