Source-linked AI summary

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

Ghadi Nehme, Faez Ahmed

arXiv:2610.03799v1cs.CVcs.LG

TL;DR

Mesh-to-CAD reconstruction seeks executable parametric programs, a challenging task because program choices are combinatorial and long-horizon. StepCAD combines a state-conditioned CAD policy with geometry-guided program search, and outperforms prior methods across benchmarks, with an 87.2% relative IoU gain on ABC Hard over the strongest baseline.

  • Problem

    Mesh-to-CAD seeks executable parametric programs rather than surface approximations, but program choices are combinatorial, long-horizon, and allow multiple programs to produce similar geometry.

    Source: §1 · p. 1, §3.1 · p. 4
  • Method

    StepCAD combines a state-conditioned CAD policy with geometry-aware tree search for local program edits, alongside the ARCADE-1.5M dataset of diverse, long-horizon CAD programs.

    Source: §1 · p. 2, §4 · p. 8
  • Results

    0.73 IoU on ABC Hard, up from 0.31–0.39 for prior methods (87.2% relative gain over the strongest baseline); StepCAD outperforms prior methods across all datasets.

    Source: §4 · p. 7
  • Takeaways & Limitations

    StepCAD's reconstruction target is geometric reproduction, not recovery of original design intent or constraints.

    Source: §1 · p. 1

    IoU and CD measure shape agreement, not recovery of original dimensions, design intent, constraints, or feature semantics.

    Source: §5 · p. 10

Abstract

from arXiv · show

Recovering executable CAD programs from 3D meshes is challenging due to the compositional nature of CAD construction and the interaction between discrete modeling choices and continuous parameters. Many learning-based methods predict complete programs in a single pass and rely predominantly on sketch-extrude representations, limiting operation diversity and opportunities to correct geometric errors during reconstruction. We introduce StepCAD, a generative optimization approach that combines a state-conditioned CAD policy with geometry-guided search. Given an input mesh, the policy predicts construction actions conditioned on both target and intermediate geometry, and an IoU-guided tree search refines the resulting program through local edits. We also introduce ARCADE-1.5M, a large-scale dataset of 1.5M executable CAD programs spanning diverse operations, sequences with a maximum length of 150+ counted operations, and 12.5M intermediate state-action transitions. Experiments across multiple CAD reconstruction benchmarks show that StepCAD achieves state-of-the-art geometric reconstruction accuracy with consistently high validity, yielding up to 87.2% relative IoU improvement over the strongest evaluated baseline, with particularly large gains on complex shapes. Project page: https://ghadinehme.com/stepcad.github.io/

1 Introduction

Mesh-to-CAD reconstruction seeks executable, editable parametric programs from existing 3D geometry, but long, compositional programs require precise operation and parameter decisions. StepCAD combines state-conditioned generation with geometric search, alongside ARCADE-1.5M training data, and reports improved reconstruction across diverse benchmarks.

1 Introduction

  • Mesh-to-CAD reconstruction targets an executable construction sequence that reproduces the input, not recovery of its original design intent or constraints.CAD programs are long-horizon and compositional, with dependencies between operations and continuous parameters that must be estimated precisely.Source: §1 · p. 1
  • Prior learning-based methods often predict a complete program without executing intermediate states, limiting opportunities to respond to evolving reconstruction.Learned refinement adds feedback, but geometric errors can remain in program structure and continuous parameters.Source: §1 · p. 1
  • The policy conditions on intermediate geometry to propose construction sequences, while geometry-aware optimization refines them for geometric fidelity.The approach combines continuous parameter optimization with discrete structural edits guided by IoU.Source: §1 · p. 2
  • ARCADE-1.5M contains 1.5M executable programs spanning diverse operations, sequences of 150+ counted operations, and 12.5M intermediate state-action transitions.StepCAD trains a state-conditioned LLM policy on this dataset before refining its candidate program through geometry-aware tree search over local edits.Source: §1 · p. 2
  • StepCAD achieves state-of-the-art results across five diverse benchmarks, with up to 87.2% relative IoU improvement over the best prior method.Gains grow with shape complexity, where prior approaches degrade most severely.Source: §1 · p. 2

2 Related Work

Prior work spans neural program generation, iterative refinement, entity-grounded CAD generation, geometric reconstruction, and CAD datasets. StepCAD distinguishes itself by combining executable program generation with explicit search scored against target geometry.

Learning-Based CAD Program Generation

  • Neural CAD generation has expanded from sketch-and-extrude sequences toward richer operation sets and conditioning from images or point clouds.Many methods still rely on amortized autoregressive prediction, which can leave geometric discrepancies in the resulting shape.Source: §2 · pp. 2–3
  • StepCAD separates program generation from optimization: a learned policy proposes structurally consistent programs, and search refines them for geometric accuracy.Its inference-time search uses execution-scored local edits, including continuous parameter optimization, sketch modification, and operation skipping.Source: §2 · p. 3

Entity-Grounded and Feedback-Driven CAD Generation

  • Entity-grounded methods select referenced B-rep edges or faces, whereas StepCAD uses a target mesh for direct geometric scoring and has coarser selectors.StepCAD can also refine compatible programs from other generators.Source: §2 · p. 3

Geometry-Driven CAD Reverse Engineering

  • B-rep reconstruction does not recover an ordered feature history, while inverse CSG search is typically limited to simple primitives and does not scale to several CAD operations.StepCAD models sequential construction and produces executable programs.Source: §2 · p. 3

CAD Datasets

  • Existing CAD datasets differ in supervision: DeepCAD and Fusion 360 emphasize sketch-and-extrude sequences, while ABC provides geometry without ordered construction history.ARCADE-1.5M is designed for long-horizon, diverse executable programs with dense intermediate supervision.Source: §2 · p. 3

3 Method

StepCAD frames mesh-to-CAD reconstruction as finding an executable parametric program whose geometry matches the target. It pairs a diverse synthetic program dataset with state-conditioned generation and local geometry-guided search.

3.1 Problem Statement

  • The reconstruction objective is to find a valid program whose executed geometry maximizes IoU with the input mesh.The program space is combinatorial, autoregressive dependencies extend across long sequences, and multiple valid programs can produce similar geometry.Source: §3.1 · p. 4

3.2 ARCADE-1.5M: Constraint-Guided Synthetic CAD Programs

  • ARCADE-1.5M provides 1.5M executable programs paired with valid geometry, spanning diverse operations and dense intermediate supervision.It combines sketch primitives and solid operations, uses workflow-inspired constraints, and stores intermediate geometry after every solid operation, yielding approximately 12.5M construction states.Source: §3.2 · pp. 4–5, Figure 1 · p. 4
  • ARCADE-1.5M constructs programs from perturbed, transformed sketch loops and sampled extrude, revolve, loft, or sweep operations, with optional fillets and chamfers.Its workflow constraints keep intermediate states as valid single-body solids with positive volume and require sufficient overlap for additive or subtractive operations; 94 heuristic strategies guide sequences ranging from 3 to 150+ operations.Source: §3.2 · pp. 4–5

3.3 StepCAD: Generative Optimization for Mesh-to-CAD Reconstruction

  • StepCAD first generates a structurally plausible executable program with a state-conditioned autoregressive policy, then applies local search to improve geometric fidelity.The policy conditions on target and intermediate geometry plus prior actions; inference alternates action prediction with CAD execution and stops at a quality plateau, end token, or 12-action cap.Source: §3.3 · p. 5, §3.3.1 · p. 6, Figure 2 · p. 6

3.3.1 Π-StepCAD: State-Conditioned CAD Policy

  • The policy is trained with teacher forcing on dense state-action trajectories from ARCADE-1.5M, with supervision at every intermediate construction step.A shared Point-MAE encoder represents target and intermediate geometries, which condition the autoregressive model.Source: §3.3.1 · p. 6

3.3.2 Geometry-Aware Program Optimization

  • Geometry-aware beam search expands local edits in execution order, executes each candidate, and ranks candidates by IoU against the input mesh.The edits optimize continuous parameters, modify sketches, add complement cuts, or skip operations; the method uses beam width 2 and four local edits per expansion.Source: §3.3.2 · p. 7

4 Experiments, Results, and Discussion

On CADBench, StepCAD outperforms prior methods across datasets, with the largest gains on complex shapes, and search improves policy IoU. Additional analyses examine state conditioning, surface fidelity, operation diversity, search transfer, and program compactness.

Quantitative Results

  • 87.2% relative IoU gain on ABC Hard (0.31–0.39 to 0.73) is StepCAD’s largest reported benchmark improvement.StepCAD also reaches 0.74 IoU on ABC Medium (72.1% gain), 0.89 on Mechanical (32.8% gain), and 0.71 on Organic (69.0% gain).Source: §4 · p. 7, Table 2 · p. 8

Benefits of state-conditioned step-by-step generation

  • On ABC Hard, Π-StepCAD reaches 0.52 IoU versus ∼0.38 before search; it remains robust on hard subsets where CADReasoner degrades.CADReasoner performs slightly better on DeepCAD and ABC Easy.Source: §4 · p. 8

Generative optimization is critical

  • 0.14 average IoU gain (∼20% relative) follows geometry-aware search, which refines program structure and numerical parameters.On ABC Hard, the full system improves from 0.52 to 0.73 IoU over the policy alone.Source: §4 · p. 8

Surface accuracy

  • Chamfer Distance is lowest on every dataset, including 0.0263 versus 0.0283 on ABC Hard and 0.0420 versus 0.0446 on Organic.The passage attributes these surface-distance improvements to better fine geometric detail as well as volumetric overlap.Source: §4 · p. 8

Disentangling training data, policy, and optimization

  • Within StepCAD, previous-geometry tokens raise IoU from 0.632 to 0.682, and search adds 0.134 to reach 0.816.The cross-model comparison with the released CADEvolve checkpoint is not a controlled data-only ablation because model and training setups differ.Source: Table 3 · p. 8, §4 · p. 8

Additional evaluation and ablations

  • Appendix evaluations report higher high-IoU success and entity accuracy, transferable search, and larger programs after refinement.StepCAD reaches IoU ≥0.95 on 39.9% of samples versus 27.2% for CADReasoner; search raises CAD-Recode mean IoU from 0.597 to 0.745 without retraining, while mean program size increases from 16.2 to 31.7 operations. Other ablations vary model scale, encoder, policy inputs, sampling, and local edits.Source: §4 · pp. 8–10

Impact of ARCADE-1.5M and operation diversity

  • On Organic, lofts appear in 30.4% of generated programs versus 3.0% for CADEvolve; lofts also recover smooth non-planar transitions at higher fidelity.Figure 3’s qualitative results show close matches to target geometry while preserving global structure and fine detail.Source: §4 · p. 9

Applications and one-to-many CAD generation

  • Π-StepCAD generates diverse editable CAD variants from one reference mesh, and multiple operation sequences can produce nearly identical geometry.The paper also describes integration into image-to-CAD pipelines using meshes from image-to-3D models.Source: §4 · p. 9

5 Limitations and Future Work

StepCAD's limitations span search capacity, fidelity objectives, entity selection, and synthetic-data generalization. The authors identify these boundaries and outline directions including feature-aware objectives, constraint modeling, and user studies.

Computation and search

  • The fixed local edits, bounded parameter neighborhoods, finite beam, and 12-action policy cap can limit search corrections and inference-time sequence length.Training sequences longer than the cap do not establish equivalent inference-time capacity.Source: §5 · p. 10

Geometric versus semantic fidelity

  • IoU and CD measure shape agreement, not recovery of original dimensions, design intent, constraints, or feature semantics.A meaningful but misparameterized fillet may be removed if search cannot find a better radius.Source: §5 · p. 10

Selection and editability

  • Coarse edge and directional-face selectors cannot address arbitrary entities, and executable editable parameters do not establish preserved constraints or successful user editing.Program compactness captures only one aspect of editability.Source: §5 · p. 10

Data and generalization

  • Synthetic training introduces a domain gap, while alternative valid histories complicate comparison with a reference B-rep.The authors propose aligned point-cloud/B-rep representations, entity-specific operators, feature-aware objectives, constraint modeling, user studies, and more efficient search as future work.Source: §5 · p. 10

Societal impact

  • Reconstruction may facilitate replication of proprietary designs and change designer workflows, motivating attribution and human oversight.Source: §5 · p. 10

6 Conclusion

The conclusion presents StepCAD as mesh-to-CAD generation paired with geometry-aware program refinement, alongside the ARCADE-1.5M dataset. It reports state-of-the-art performance across benchmarks and frames generative optimization as a broader structured-program-synthesis direction.

Conclusion

  • StepCAD combines a state-conditioned CAD policy with geometry-aware program refinement to reconstruct meshes.The paper frames generation as optimization in program space.Source: §6 · p. 10
  • ARCADE-1.5M provides CAD programs with diverse operations and long-horizon construction sequences for training state-conditioned models.Source: §6 · p. 10
  • The authors report state-of-the-art performance across multiple benchmarks and substantial improvements in fidelity, robustness, and generalization.Source: §6 · p. 10
  • The paper proposes extending the generative-model-plus-search paradigm to image-to-CAD generation, interactive design, and automated engineering workflows.Source: §6 · p. 10

A Ablations

The supplied appendix passages describe ablation measures, a model-scale result, and examples of varied CAD generation and reconstruction. They do not provide the ablation table values or outcomes for most comparisons.

A.1 Which Components of Π-StepCAD Matter Most?

  • Table 4 evaluates StepCAD ablations using CD and IoU for reconstruction quality and VSR for valid shape rate.Source: Table 4 · p. 17

A.2 How Do Model Scale and Geometry Encoders Affect Performance?

  • The 3B model has the lowest early validation loss, but its gain over the 1.5B model is marginal at 0.0014; the 1.5B Point-MAE configuration is the default for its compute-performance trade-off.Source: §A.2 · p. 17

A.3 Which Local Edits Contribute Most to Geometry-Aware Search?

  • The local-edit ablation reports win rate and realized IoU lift by search phase, while the accompanying cost measure is mean wall-time per sample.Source: Table 6 · p. 17, §A.3 · p. 17

B.1 Variants Generation

  • Π-StepCAD generates parametric CAD variants that preserve overall structure while changing geometric details and construction choices.Source: Figure 4 · p. 18

B.2 Image-to-CAD

  • In the image-to-CAD example, Hunyuan3D [6] first converts an image to a 3D mesh, which StepCAD reconstructs as an editable parametric CAD program.Source: Figure 5 · p. 18

C One-to-Many Mapping: From Geometry to CAD Construction Sequence

  • For one target mesh, StepCAD produces valid programs with different sequences, including loft-based or revolve-based constructions followed by shell and chamfer operations, with nearly identical final geometry.Source: Figure 6 · p. 19

D Analysis of Generated CAD Operation Distributions

The supplied captions define operation occurrence as the percentage of generated CAD programs containing at least one instance of an operation.

D Analysis of Generated CAD Operation Distributions

E Construction Trajectories, Search Behavior, and Qualitative Evaluation

The qualitative figures show construction trajectories, search edits, expanded reconstructions, and residual or failure cases. They compare policy outputs with refined reconstructions and illustrate IoU-guided candidate selection.

  • Figures 7 and 9 provide an evaluation-input gallery across six datasets and expanded qualitative reconstructions, respectively.The gallery uses the supplied category labels.Source: Figure 7 · p. 20, Figure 9 · p. 21
  • Figure 8 follows four examples from target mesh through intermediate solids and policy output to the refined StepCAD reconstruction.The trajectory panels show the construction process alongside refinement.Source: Figure 8 · p. 20
  • Figure 10 compares four edit proposals from a shared parent and shows parameter correction achieving higher IoU than removing a chamfer or fillet in the examples.The figure also traces retained and rejected candidates during beam search.Source: Figure 10 · p. 22
  • Figure 11 presents target meshes, policy outputs, and refined reconstructions with IoU to show residual errors and failure cases.Source: Figure 11 · p. 22

F Metrics

The metrics assess volumetric shape overlap, point-cloud surface distance, and whether generated programs execute successfully and yield valid geometry.

  • IoU measures volumetric overlap between predicted and target shapes.Source: F Metrics · p. 23
  • Chamfer Distance (CD) measures surface distance between point clouds, with lower values preferred.Source: F Metrics · p. 23
  • Valid Shape Rate (VSR) is the percentage of generated programs that execute successfully and produce valid geometry.Source: F Metrics · p. 23

G Dataset Statistics

ARCADE-1.5M spans varied shape scales and long construction programs, while its generation pipeline builds, validates, and records executable CAD scripts and geometry. The supplied material also describes the policy’s geometry-conditioned, stepwise generation process.

G Dataset Statistics

  • Operation counts span 3 to 150+, with a median of 33 and a mean of 40.3 across dataset programs.Figure 12 summarizes face count, volume, solid operations, and total operations per program.Source: Figure 12 · p. 24

H.1 Sketch Database

  • The sketch database samples uniformly from entries containing lines, arcs, circles, or splines, then scales and places sketches on a randomly chosen bounding-box face.Control points are transformed to place the sketch within the selected face.Source: §H.1 · p. 24, §H.2 · p. 25

H.3 Primitive Code Generation

  • Primitive code generation supports extrude and revolve operations, spline-path sweeps, and offset or transformed lofts, with optional per-primitive fillets or chamfers.Lofts vary cross-sections across profiles; finishing features may be applied before solids enter the Boolean tree.Source: §H.3 · p. 25

H.4 SolidFactory: Bounding-Box-Driven Dispatch

  • SolidFactory generates code from a bounding box and validates its executed solid; ModelBuilderV2 accumulates code and updates the current solid only when an attempted operation succeeds.Base solids and face-placed bosses provide starting and additive features.Source: §H.4 · p. 26, §H.5 · p. 26

H.5 ModelBuilderV2: Composing Primitives into Parts

  • The builder composes parts with spatial patterns, mirroring, shells, and Boolean cuts; cuts are rejected when tool intersection with the solid is below 20%.A pattern commits only after at least two tool applications succeed.Source: §H.5 · pp. 26–27

H.6 Code Assembly and Post-Processing

  • Final scripts join code fragments, export the result, and post-process variables and geometry calls; dataset artifacts include executable scripts, STEP geometry, and optional meshes.Programs use explicit sketch primitives, volumetric and Boolean operations, topology and finishing operations, and spatial patterns.Source: §H.6 · pp. 27–28, §H.9 · p. 29

H.7 Strategy Library

  • Ninety-four strategy functions span seven complexity tiers, including long-sequence and operation-subset strategies; generation uses isolated workers and independently re-executes scripts for validation.The second validation checks single-body status, volume, and B-Rep validity.Source: §H.7 · p. 28, §H.8 · p. 28

I.1 Inputs

  • At each step, the policy conditions on target and intermediate point clouds plus geometry metadata, predicts a CadQuery action, executes it, and re-encodes the resulting geometry.Point-MAE encodes the point clouds; Qwen2.5-Coder-1.5B predicts construction actions autoregressively.Source: §I.1 · p. 30, §I.2 · p. 30, §I.5 · p. 30

I.7 Training Setup

This section describes StepCAD’s training and geometry-guided refinement setup, including state-action supervision and reported transfer and reconstruction-fidelity/program-length trade-offs. It also summarizes reproduction and implementation details, planned code and dataset release upon acceptance, and scope and ethics declarations.

I.7 Training Setup

  • Training used cross-entropy and full language-model fine-tuning, with separate encoder and LLM learning rates, warmup and cosine decay, and 100,000 steps on eight H100 GPUs.The policy receives dense trajectory-level supervision over approximately 12.5 million construction states, rather than supervision only on final programs.Source: §I.7 · pp. 30–31, §I.8.3 · p. 31

I.8.4 Closed-Loop Rollout Procedure

  • At inference, closed-loop generation alternates autoregressive prediction with CAD execution, samples a point cloud from produced geometry, and feeds it back so the policy conditions on actual rather than teacher-forced intermediate states.Source: §I.8.4 · p. 32

J.1 Beam Search Procedure

  • Geometry-aware beam search expands local edits in operation order and ranks candidates by IoU, while Bayesian optimization refines scalar operation parameters.The search uses beam width 2 and four local edits per expansion; parameter refinement accepts changes only when they improve IoU.Source: §J.1 · p. 33, §J.2 · pp. 33–34

J.3 Sketch Extraction and Replacement

  • Local edits replace sketches using target-mesh intersections, skip operations that improve IoU when removed, or append complement cuts to remove overshoot.Sketch replacement preserves operation type and extrusion depth; skipping can remove redundant or erroneous operations, and up to two complement-cut rounds are allowed.Source: §J.3 · p. 34, §J.4 · p. 34, §J.5 · pp. 34–35

K.2 Transfer to Independently Generated Programs

  • Applying refinement to CAD-Recode programs raised mean IoU by 0.148 on 1,200 CADBench samples, without retraining.The refinement uses the target mesh and an executable seed program, not policy weights; this transfer result does not establish compatibility with arbitrary CAD languages or structures.Source: Table 10 · p. 35, §K.2 · p. 35

K.3 Entity-Level Geometric Accuracy

  • StepCAD had the highest reported vertex, edge, and face accuracy on CADBench datasets with reference B-reps.Entity accuracy complements global IoU, but depends on matching and reference decomposition and does not uniquely measure construction-history correctness; high-IoU success likewise measures volumetric fidelity, not parameter accuracy or localized feature correctness.Source: §K.3 · pp. 35–36, §K.1 · p. 35, Table 11 · p. 36

K.4 Program Size and Reconstruction Quality

  • Search increased mean program size from 16.2 to 31.7 operations as IoU improved from approximately 0.68 to 0.82.The policy alone produced the shortest programs among listed methods while exceeding their reported IoU, so refinement trades program length for fidelity rather than uniformly simplifying programs.Source: Table 12 · p. 36, §K.4 · p. 36

K.5 Conciseness Relative to Reference Programs

  • StepCAD’s overall recovered-to-reference sequence-length ratio was 0.91, with IoU of 0.89 on DeepCAD.A lower ratio alone does not imply better reconstruction, since omitted geometry can shorten a program.Source: Table 13 · p. 36, §K.5 · p. 36

NeurIPS Paper Checklist

  • The paper reports reproduction information in the paper and appendices, plans code and dataset release upon acceptance, and says its synthetic dataset poses no identifiable-human-data or privacy risks.Source: NeurIPS Paper Checklist · pp. 38–40
  • Training/test and compute details are in the appendix, but confidence intervals and error bars are omitted due to high computational cost.Source: NeurIPS Paper Checklist · pp. 39–40

10. Broader impacts

  • The authors report discussing both potential positive and negative societal impacts in Section 5.Source: §10 · p. 40

11. Safeguards

  • The authors mark safeguards as not applicable, stating that the paper poses no such risks.Source: §11 · p. 41

12. Licenses for existing assets

  • The authors state that external datasets, models, and software are credited and their licenses and terms of use respected.Source: §12 · p. 41

13. New assets

  • The dataset, model, and evaluation pipeline are documented, and the authors plan to release the assets and documentation upon acceptance.Source: §13 · p. 42

14. Crowdsourcing and research with human subjects

  • The paper reports no crowdsourcing or human-subject research.Source: §14 · p. 42

16. Declaration of LLM usage

  • The authors mark LLM-usage declaration as not applicable because core method development does not use LLMs as important, original, or non-standard components.Source: §16 · p. 43
Loading 2610.03799v1…