Source-linked AI summary
CADENA: Stepwise CAD Reverse Engineering
Soslan Kabisov, Gennadiy Savrasov, Maksim Elistratov, Antonio Rodriguez, Daniil Ignatiev, Nikita Gavrilov, Rustam Uzdenov, Alexey I. Boyko, Igor Pasechnik, Anton Konushin, Andrey Kuznetsov, Dmitrii Zhemchuzhnikov
TL;DR
Recovering editable parametric CAD from raw geometry remains difficult, while most AI systems generate programs in one pass without checking intermediate geometry. CADENA instead reconstructs parts stepwise with geometric feedback and outperforms prior methods across evaluated datasets.
Problem
Raw meshes lack editable parametric structure, while existing reverse-engineering systems generate complete CAD programs without inspecting intermediate geometry.
Method
CADENA emits and executes one CAD operation at a time, using visual residual feedback and executed-geometry rewards to guide subsequent operations.
Results
CADENA outperforms prior methods on every evaluated dataset, with larger gains on geometrically complex real mechanical parts; reinforcement learning also improves accuracy and reduces invalid outputs.
Takeaways & Limitations
CADENA-Bench reports performance by mechanical-part family, making methods’ domain of applicability visible rather than averaged away.
Takeaways & Limitations
CADENA does not lead every part family, lacks a matched single-pass training comparison, and its CadQuery programs may not transfer faithfully to industrial CAD software.
Abstract
from arXiv · showhide
Computer-Aided Design (CAD) underpins modern engineering, yet converting existing shapes into editable models still demands substantial expert effort. Most AI systems emit the entire CAD program in a single pass, never inspecting the intermediate geometry. In contrast, human engineers build a part feature by feature, checking after each operation what remains to be modeled. We introduce CADENA (Spanish for "chain"), a model that reconstructs a 3D mesh as a parametric CAD program, growing its sequence of operations one at a time and comparing the target with the currently predicted geometry at every step. We also address the lack of benchmarks for evaluating reverse-engineering methods on mechanical parts, introducing CADENA-Bench, a benchmark that measures performance across categories of mechanical parts. CADENA outperforms prior methods on CADENA-Bench and on the DeepCAD, Fusion 360, and MCB datasets. Code is available at https://github.com/zhemdi/cadena, model weights at https://huggingface.co/kulibinai/cadena, and CADENA-Bench at https://huggingface.co/datasets/kulibinai/cadena-bench.
1 Introduction
CADENA addresses the limitations of one-pass CAD reverse engineering by generating operations stepwise with geometric feedback. The paper also introduces CADENA-Bench and GMS to improve evaluation on real mechanical parts.
- 1 Introduction: Raw meshes lack editable semantic handles such as bores, fillets, and walls, limiting their reuse in mechanical engineering.Meshes can be rendered and printed but cannot directly support feature-level modifications.
- 1 Introduction: Existing learning-based systems emit complete CAD programs in one pass without inspecting produced geometry, allowing early errors to compound silently.They condition subsequent choices on program text rather than the residual geometry still requiring reconstruction.
- 1 Introduction: CADENA emits and executes one operation at a time, conditioning decisions on residual geometry so operations can be selected independently of program progress.It is trained with supervised fine-tuning and refined through online reinforcement learning rewarded by executed geometry.
- 1 Introduction: CADENA-Bench contains 3396 real mechanical parts across six part families and reports results per family rather than averaging performance away.The benchmark targets reconstruction, unlike existing corpora developed mainly for classification or retrieval and dominated by simple or near-duplicate shapes.
- 1 Introduction: The paper introduces GMS as a surface-matching metric and reports CADENA’s best results on DeepCAD, Fusion360, MCB, CADENA-Bench, and BenchCAD.The introduction identifies shape-only metrics as poorly suited to evaluating recovered programs.
2 Related Work
Prior CAD research spans generative program synthesis, non-executable geometric reconstruction, direct program reconstruction, and iterative agent-style generation. CADENA is positioned within executable-program reconstruction while emphasizing how frequently intermediate programs are executed and evaluated during stepwise generation, alongside a benchmark addressing limitations of existing evaluation datasets.
- Generative CAD modelling: Generative CAD models synthesize construction-history programs, but generally target unconditional or text-conditioned generation and use sketch-and-extrude representations.DeepCAD introduced a transformer for sketch–extrude sequences and supplied the corpus used by much subsequent work; Fusion 360 Gallery provides human-designed examples.
- Reconstruction into non-program representations: Another research direction reconstructs structured geometric representations rather than executable programs, including directly detected, assembled, or generated boundary representations.The passage identifies both primitive-based B-Rep recovery and autoregressive or diffusion-based B-Rep generation.
- CAD reverse engineering: Executable-program reconstruction methods differ primarily in how often they execute the predicted program during decoding, with most systems not executing it while writing.Examples include CAD-Recode, cadrille, and CADEvolve, which map geometry or multimodal inputs to CAD programs using different learning approaches.
- Iterative and stepwise generation: Iterative generation methods introduce feedback loops, but usually interact at the whole-program level and mediate feedback through language.Agent-style systems such as CAD-Assistant and IterCAD use VLMs and CAD sandboxes for multi-turn interaction with evolving designs.
- Iterative and stepwise generation: SOV-CAD also reconstructs CAD iteratively with rendered visual feedback, but formulates the task as offline reinforcement learning with a Decision Transformer over orthographic projections and the active sketch.The passage explicitly contrasts these methodological foundations with CADENA.
- Benchmarks and metrics: Evaluation typically uses DeepCAD and Fusion 360 splits dominated by sketch–extrude parts, while mechanical-component corpora are rarely used for reverse engineering because they contain simple primitives and near-duplicates.The passage names MCB, TMCAD, and CADNet as datasets originally assembled for classification, retrieval, or machining-feature recognition.
3 Method
CADENA formulates mesh reconstruction as a sequential geometry-conditioned process: it repeatedly observes the target and executable partial build, then appends one CAD operation. Its multi-view residual representation, constrained DSL, stepwise supervision, and IoU-based selection support iterative reconstruction without reading prior program text.
- Sequential reconstruction: CADENA reconstructs a target mesh by appending operations sequentially, with each prefix executed into a partial solid that supplies the build state.The program is represented as P = (o1, …, oT), and reconstruction proceeds one operation at a time from S0 = ∅.
- Geometry-conditioned observation: The partial build is the sole history carrier, so the next operation depends on geometry rather than the code text that generated the current state.The DSL avoids unresolved earlier variables by consuming and rebinding a single construction variable r, making every step a valid continuation of any prefix.
- Geometry-conditioned observation: The policy conditions on a multi-view image that overlays target and current-build geometry, plus a text-provided 3D hint for selecting among disconnected discrepancies.The meshes share a coordinate frame and are rendered from eight viewpoints: six axis-aligned orthographic views and two isometric views.
- Training: Training uses single-step supervised examples from executable prefixes, followed by two stages containing 1.86 million warm-up samples and 18.0 million main-stage samples.The warm-up uses programs of at most two operations, while the main stage uses programs of up to twelve operations with lengths from 2 through 12.
- Training: Reinforcement learning fine-tunes next-operation choices with one-step signals based on volumetric IoU between the current solid and target.The policy generates and executes trajectories, but optimization avoids whole-trajectory objectives because execution dominates rollout cost.
- Inference and selection: At inference, CADENA returns the executable prefix with maximum target IoU, allowing damaging late operations to be rejected without labels.Every prefix is scored against the input target mesh, and selection therefore remains available during testing.
4 CADENA-Bench and the GMS metric
CADENA-Bench provides 3,396 deduplicated mechanical parts organized into six families, while GMS evaluates reconstruction agreement using both surface position and normals. GMS is used only for evaluation, whereas training and prefix selection rely on volumetric IoU.
- CADENA-Bench: CADENA-Bench contains 3396 unique mechanical parts from MCB, TMCAD, and CADNet, deduplicated and classified into six part families.The families are shafts & bushings, gears & bearings, housings & frames, flat & levers, springs & fasteners, and tooling & gauges.
- GMS metric: GMS matches reference and reconstructed points only when both positions and surface normals agree, combining recall and precision harmonically.This prevents high scores from covering the target while adding spurious material or reproducing only a small precise fragment.
- GMS metric: GMS is used only for evaluation because optimizing it as an RL reward improved GMS without improving Chamfer distance or IoU and performed markedly worse on the MCB subsample.Reported policies are trained against volumetric IoU and select their returned prefix using the same criterion.
5 Experiments
Experiments evaluate CADENA and baselines across DeepCAD, Fusion360, MCB, and CADENA-Bench under fixed-frame, validity-aware protocols. CADENA-RL performs especially well on harder mechanical parts, while validity and decoding substantially affect reported outcomes.
- Evaluation setup: Experiments use greedy single-sample decoding from released checkpoints on DeepCAD, Fusion360, MCB, and CADENA-Bench.Baseline configurations use each method’s reported strongest modality or publicly released checkpoint.
- Evaluation protocol: The protocol preserves absolute scale and placement, averages metrics only where defined, and reports invalid predictions separately rather than substituting values.Predictions must build into watertight solids; invalid outputs contribute to invalid rate and are excluded from means.
- CADENA-Bench results: Every learned method loses roughly half its GMS from DeepCAD to CADENA-Bench, while CADENA-RL falls from 97.0 to 67.0 and widens its advantage.The strongest-baseline margin increases from 1.7 points on DeepCAD to 12.2 on CADENA-Bench.
- CADENA-Bench results: CADENA-RL leads five of six part families, with its largest margins on springs & fasteners and shafts & bushings.CADFit is the exception on gears & bearings, reaching 61.3 versus CADENA-RL’s 58.1.
- Validity: Invalid rates vary sharply: cadrille reports 0.3–1.5%, versus 31.7% for CADReasoner on MCB and 21.5% for CAD-Recode.CADReasoner failures include degenerate arcs and programs truncated by repetition loops.
- Decoding: Sampling never underperforms greedy decoding; SFT on MCB improves from 63.3 to 70.0 GMS and invalid rate from 12.04% to 0.36%.RL remains ahead of SFT under both decoding rules, and RL on DeepCAD improves from 97.0 to 97.4 GMS.
6 Limitations
CADENA has bounded coverage and unresolved attribution: CADFit surpasses it on gears and bearings, while the absence of a single-pass model trained on CADENA’s corpus prevents isolating stepwise inference from training-data effects. Its fixed-view, DSL, feature-counting, and plane-selection constraints also create specific failure modes.
- Coverage and attribution: 61.3 GMS: CADFit exceeds CADENA’s 58.1 on gears & bearings through direct surface fitting.Geometry optimization against the target does not require training-distribution coverage of rotationally patterned parts.
- Coverage and attribution: CADENA lacks a reported single-pass model trained on its own corpus, preventing separation of stepwise inference from training-data effects.The passage identifies this as an unresolved limitation rather than reporting a comparative result.
- Failure modes: Fixed eight-view observation makes geometry hidden from every canonical viewpoint invisible to CADENA.This limitation bounds the method outside its iterative reconstruction loop.
- Failure modes: Features without DSL operations are approximated with extrusion stacks, while countable features such as gear teeth may be approximated rather than counted.One tooth too few can leave almost the same residual as the correct part.
- Failure modes: An early operation choosing the wrong plane is another failure mode that bounds CADENA’s reconstruction method.The supplied passage states this failure mode but does not provide its downstream consequence.
7 Conclusion
CADENA outperforms prior methods across all evaluated datasets, with larger gains on geometrically complex real mechanical parts than on sketch–extrude corpora. Reinforcement learning improves reconstruction accuracy and reduces invalid outputs, while CADENA and CADFit are complementary and better combined.
- CADENA outperforms prior methods on every evaluated dataset, with gains growing from modest on sketch–extrude corpora to substantially larger on real mechanical parts.The margin is not uniform and increases with geometric complexity.
- Reinforcement learning against executed geometry improves reconstruction accuracy while reducing the invalid rate.
- CADENA and CADFit have complementary failure modes, making them better combined than treated as alternatives.
A.1 Comparison with SOV-CAD
CADENA is compared with SOV-CAD using published DeepCAD figures rather than a controlled evaluation because SOV-CAD releases no trained model. The comparison uses different protocols, and the reported gap may understate CADENA’s advantage.
- A.1 Comparison with SOV-CAD: SOV-CAD releases no trained model, preventing evaluation under the protocol used elsewhere in the paper.Table 5 therefore places SOV-CAD’s reported DeepCAD figures beside CADENA’s results.
- A.1 Comparison with SOV-CAD: Table 5 compares published numbers rather than controlled results because SOV-CAD and CADENA use different evaluation protocols.SOV-CAD’s values come from its Table II, while CADENA uses the CADENA-RL row of Table 1.
- A.1 Comparison with SOV-CAD: The reported gap may understate CADENA’s advantage because its fixed-frame evaluation and restricted averaging convention cost several points relative to SOV-CAD’s conventions.SOV-CAD’s table also omits the point count for its median Chamfer distance, whereas CADENA’s quoted value uses 8k points.
A.2 DSL grammar and argument conventions
The CADENA DSL emits a stepwise chain that repeatedly consumes and rebinds the running solid r, with auxiliary workplanes, first-operation gear, and selector-chain edge operations as exceptions. Shared arguments use world-coordinate points, a three-value plane enum, global in-plane sketch coordinates, and signed normalized lengths.
- Program structure: Each program begins with a fixed import preamble and r = None, then emits one operation per line that consumes and rebinds r.Because later lines do not depend on newly bound names, every step remains a valid continuation of any earlier prefix.
- Program structure: Auxiliary workplanes bind w{i}, gear consumes that workplane instead of r and therefore appears only first, while fillet and chamfer use CadQuery selector chains.These are the documented departures from the plain r = op(r, ...) form.
- Shared arguments: Most 3D operations share an (r, point, plane, sketch, ...) prefix; point uses world coordinates, and plane is exactly ’XY’, ’YZ’, or ’ZX’.The plane normals are +Z, +X, and +Y respectively; when r is present, point is additionally snapped onto the existing solid.
- Shared arguments: Lengths are signed normalized integer units, with positive values directed along the positive plane normal.The point and length conventions use the same normalized integer frame.
- Shared arguments: A sketch is a double-quoted CadQuery chain beginning with sketch() and ending with .finalize(), using global in-plane coordinates and vocabulary including push, segment, arc, and circle.Subtractive sub-profiles use mode=’s’; the sketch string carries no offset information.
- Naming conventions: The helical-sweep operation is named helix in pre-refactor generated material and spring afterward, with an unchanged argument list.The naming difference reflects generator history rather than a change in operation arguments.
A.3 RL experiments
The RL experiments clarify checkpoint naming and compare reward variants within a fixed training procedure. They support omitting the KL penalty and reserving GMS for evaluation rather than training.
- Checkpoint definitions: The RL (IoU) row denotes the CADENA-RL checkpoint reported in Table 1.SFT rows use the final checkpoint from the second supervised stage.
- Checkpoint definitions: SFT rows in this appendix correspond to the final checkpoint of the second supervised stage.
- Reward experiments: The appendix varies only the reward within the one-step GRPO procedure and evaluates its effect on reconstruction quality.The procedure uses a programmatic environment, a self-generated reference trajectory, group filtering, and candidate selection.
- Reward experiments: These experiments support excluding the KL penalty from the objective and using GMS strictly for evaluation, not as a training signal.
A.3.1 Setup
The experiments train all configurations on the same RL dataset while varying only the reward function, and evaluate them on specified dataset subsamples using greedy decoding.
- All configurations are trained on the RL dataset described in Section 3 and differ only in their reward function.
- Evaluation uses 1000-example subsamples from DeepCAD, Fusion 360, and MCB.
- All numbers are obtained under greedy decoding, with full test splits checked for one subsample pair against noise.
A.3.2 Reward definitions
CADENA defines rewards using volumetric IoU and a two-threshold mean precision/recall score computed from sampled mesh-surface distances. IoU+KL adds a KL penalty to the IoU reward, while GMS is evaluated separately as a possible reward.
- IoU: Volumetric IoU measures overlap between the constructed solid and target mesh directly from their meshes.The RL (IoU) configuration uses this reward with the base procedure and no KL penalty.
- MPR: MPR samples N = 20,000 surface points from target and predicted meshes and compares absolute signed distances to the opposite mesh.For threshold τ, precision and recall are combined as a weighted sum M(τ) = wP P(τ) + wR R(τ).
- MPR: MPR distances use a normalized frame with the bounding box’s largest side scaled to 200 units, evaluating strict and coarser surface deviations at τ = 0.5 and τ = 1.0.The two thresholds provide a two-level score combining close surface matching with tolerance for larger local shape errors.
- Alternative reward configurations: The RL (IoU + KL) configuration trains on IoU with an added KL penalty relative to the SFT reference policy.Whether GMS can also serve as a reward is tested separately in Section A.3.4.
A.3.3 Comparison of reward variants … A.7 Failure cases
Across reward, inference, benchmark, comparison, and failure analyses, CADENA’s gains come from geometry-aware stepwise reconstruction but remain limited by reward trade-offs, incomplete observations, DSL coverage, and irreversible early decisions.
- A.3.3 Comparison of reward variants: Every RL configuration improves over SFT across all three subsamples, raising mean IoU, lowering median CD, and reducing invalid programs.MPR is competitive with IoU, while precision-weighted MPR (wP = 0.9) overtakes IoU on mcb-1000 mean IoU.
- A.3.3 Comparison of reward variants: Adding a KL penalty wins mean IoU, GMS, and IR but loses median CD on subsamples; full-test results show only small, inconsistent differences.The RL (IoU) and RL (IoU + KL) checkpoints were recomputed on full test splits, where the subsample advantage was not confirmed.
- A.3.4 GMS as a reward: Optimizing GMS produces the largest mean-GMS gain on every dataset but degrades geometry, with mcb-1000 median CD increasing from 0.1490 to 0.3035.On all three subsamples, mean IoU falls below the starting checkpoint; the IoU reward instead improves both IoU and CD on mcb-1000.
- A.4 Inference-time ablations: The second operation adds +4.4, +4.9, and +3.9 GMS on DeepCAD, Fusion360, and MCB, while the full budget adds +6.0, +7.4, and +7.6.Median operation counts are 2 on DeepCAD and Fusion360 and 4 on MCB; gains concentrate in hard parts, including 21.3 GMS for DeepCAD’s worst quartile.
- A.4 Inference-time ablations: Best-prefix selection rescues at least 0.10 IoU for 14% of DeepCAD, 17% of Fusion360, and 15% of MCB parts, while geometry conditions operation choice.CADENA opens with extrude on 80.1% of DeepCAD parts and revolve on 73.2% of MCB parts, unlike the nearly position-agnostic corpus distribution.
- A.5 Full evaluation on CADENA-Bench: CADENA-RL achieves the best overall trade-off between reconstruction quality and reliability on CADENA-Bench, leading CD8k, CD30k, IoU, and GMS in nearly every class.CADFit† is marginally higher only on GMS for Gears & bearings, despite substantially higher IR there.
- A.6 Methods we could not compare against: Several recent systems are omitted because they cannot be fairly executed: SOV-CAD lacks checkpoints, CADFS’s renderer reconstruction reaches 55.6 IoU versus 68.0, and HistCAD and IterCAD lack public implementations.Using approximated or proprietary input pipelines could confound or understate competing methods, so the paper reports omissions rather than weak comparison rows.
- A.7 Failure cases: Four recurring failures arise from countable-feature ambiguity, occluded geometry, out-of-vocabulary features, and unrecoverable early frame errors.Occlusions cannot be recovered from eight rendered views; unsupported geometry is approximated by available DSL primitives; and best-prefix selection prevents worsening but cannot repair a wrong frame.