Skip to content
AI.info

Research

CADMorph: Geometry-Driven Parametric CAD Editing via a Plan-Generate-Verify Loop

Overview Research area: Computer-Aided Design (CAD) meets generative deep learning — specifically geometry-driven parametric CAD editing, listed under Computer Vision (arXiv:2512.11480v2 [cs.CV], revi

arXiv
2512.11480
Published
2025-12-12
Authors
Weijian Ma, Shizhao Sun, Ruiyu Wang, Jiang Bian

AI summary

Overview

  • Research area: Computer-Aided Design (CAD) meets generative deep learning — specifically geometry-driven parametric CAD editing, listed under Computer Vision (arXiv:2512.11480v2 [cs.CV], revised 05 Jan 2026; authors Weijian Ma of Fudan University, Shizhao Sun and Jiang Bian of Microsoft Research Asia, and Ruiyu Wang of the University of Toronto).
  • Technical level: Advanced. The method assumes familiarity with latent diffusion models, cross-attention maps, autoregressive LLM infilling, signed distance fields, and test-time scaling with verifiers.
  • Scope: The paper formalizes geometry-driven parametric CAD editing and proposes CADMorph, an iterative plan–generate–verify framework that couples a parameter-to-shape diffusion model with a masked-parameter-prediction LLM to turn an original construction sequence plus a target shape into an edited sequence.

What This Paper Is About

A CAD model carries two coupled representations: a parametric construction sequence (ordered operations such as Line and Extrude with numeric parameters) and the visible geometric shape rendered from it. When engineers adjust the shape, the parametric sequence — the authoritative source for manufacturing — must be edited in sync, a laborious and error-prone process. CADMorph takes an original parametric sequence and a target geometry-only shape as input, and produces an updated sequence whose rendering matches the target while staying as close as possible to the original sequence's structure.

Key Contributions

  1. Formalizes the task. Geometry-driven parametric CAD editing is defined as finding C′ that minimizes a combination of geometric discrepancy to the target shape S′ and a structure-similarity penalty relative to the original sequence C.
  2. Two complementary pretrained models, no triplet supervision. A parameter-to-shape (P2S) latent diffusion model trained on ⟨parametric sequence, shape rendering⟩ pairs, and a masked-parameter-prediction (MPP) LLM trained on large-scale construction sequences. Neither requires the scarce ⟨original sequence, target shape, updated sequence⟩ triplets that the task would normally demand, sidestepping the data-scarcity bottleneck.
  3. The plan–generate–verify loop. Planning analyzes the P2S model's cross-attention maps to localize which sequence segments no longer contribute to the target shape and masks them; generation uses the MPP model to infill those masks with candidate edits; verification embeds each candidate and the target shape in the P2S latent space and keeps the closest one. The three stages respectively target structure preservation, semantic validity, and shape fidelity.
  4. Downstream applications and ablations. Demonstrates iterative editing and refinement of reverse-engineering results, plus ablation studies isolating the contribution of each stage and of the verifier's priority queue.

Main Findings

  • Quantitative superiority across every reported metric. On the 2k CAD-Editor test set, CADMorph achieves IoU 0.687, mean Chamfer Distance 0.009, median CD 0.0031, JSD 0.621, Invalid Rate 3.1%, Edit Distance 16.87, and Human Eval rank 1.37. The strongest baseline, CAD-Diffuser, reaches IoU 0.548, mean CD 0.097, median CD 0.0093, JSD 0.689, IR 5.7%, Edit Distance 17.29, and Human Eval 1.94. FlexCAD reaches IoU 0.447, mean CD 0.029, median CD 0.0065, JSD 0.634, IR 15.3%, Edit Distance 22.29, Human Eval 2.35.
  • General-purpose VLMs struggle badly. GPT-4o scores IoU 0.247, mean CD 0.107, IR 25.1%, Human Eval 4.57. The reasoning variants do not help: o4-mini gets IoU 0.185, mean CD 0.118, IR 32.95%, Human Eval 5.40; o4-mini-high gets IoU 0.193, mean CD 0.100, IR 40.5%, Human Eval 5.37. Adding visual-reasoning enhancement produced no gains, underscoring the gap between generic VLM capability and this task.
  • Cross-attention localizes segments to edit. When a shape and sequence come from the same CAD model, attention peaks align tightly (the "Line" segment attends to the line in the shape); when they come from different models, segments irrelevant to the target (such as "Arc") receive low attention scores while relevant ones (such as "Line", "Circle") still correlate.
  • Edits are minimal rather than wholesale rewrites. Compared with CAD-Diffuser, CADMorph reuses an existing cylinder and adjusts its parameters where CAD-Diffuser collapses two original cylinders into one; in another example CADMorph preserves a circular hole from the original sequence while CAD-Diffuser proposes an adjacent arc — a distinction that matters because drilling a hole and cutting an inward arc involve distinct manufacturing processes.
  • Ablations confirm each stage matters. Removing the verifier's priority queue lowers IoU from 0.687 to 0.619; removing the verification stage drops IoU to 0.517 (mean CD rises to 0.023, IR to 10.7%); removing the planning stage drops IoU to 0.447 (mean CD 0.029, IR 15.3%, Edit Distance 22.29). With no verification feedback the variant picks candidates at random; with no planning, segments are chosen at random.
  • Human evaluation favors CADMorph. Five human annotators ranked 200 outputs from each method, judging both how closely the rendered shape matches the target and how well the edited sequence preserves the original structure; CADMorph received the highest preference.
  • Runtime trade-off. CADMorph takes 7.26 minutes per example (elapsed and inference time identical), versus 0.18 for CAD-Diffuser and 0.13 for FlexCAD, 1.27 elapsed / 1.07 inference for GPT-4o, 5.36 / 3.24 for o4-mini, and 6.02 / 5.32 for o4-mini-high. The paper reports CADMorph's total elapsed time as only about 20% longer than the GPT-based reasoning variants while delivering better editing performance.
  • Unexpected cleanup behavior. When the given shape is inaccurate — for instance legs not fully flush with a panel — CADMorph silently corrects it, which the authors hypothesize comes from design knowledge absorbed by the MPP model during pretraining and CAD-specific fine-tuning.

Methodology in Plain English

The system keeps two pretrained specialists and runs them against each other in a loop of up to 10 iterations, rather than training a single model on editing examples that do not exist in dataset form.

Planning. Starting from the current sequence (the original sequence on the first round), the system asks the P2S diffusion model which parts of the sequence matter for the target shape. Cross-attention maps inside the diffusion model reveal which sequence segment is responsible for which geometric part. The method computes, for each segment, the absolute change in its cross-attention score between the previous shape and the target shape (Equation 2). Segments whose influence changed the most — in practice those above the mean, after ranking — are deemed mismatched and replaced with a special [mask] token. This confines edits to the segments actually responsible for the discrepancy and leaves the rest untouched.

Generation. The masked sequence goes to the MPP model, a LoRA-finetuned Llama-3 8B adapted from FlexCAD's architecture with hierarchical masking strategies. It autoregressively infills the masked segments N times, producing multiple candidate sequences with syntactically correct and semantically plausible edits, drawing on CAD knowledge from pretraining and fine-tuning.

Verification. Each candidate is diffused through the P2S model into the shape latent space, while the target shape is encoded into the same space by the P2S shape encoder. The candidate with the smallest Euclidean distance to the target is selected (Equation 4). A priority queue retains the X best candidates seen across all iterations, which enlarges the search horizon: it rescues good candidates from earlier rounds and dampens the effect of occasional noisy ones. The loop ends when the sequence converges or the iteration cap is reached.

Representation and training. Shapes are voxelized truncated signed distance fields (tSDFs) with distance range [-0.2, 0.2]. The appendix argues tSDFs are chosen for exact boundary geometry, compatibility with the convolutional attention grids used to read cross-attention, and differentiable Boolean composition (union via min, difference via max of f_A and −f_B, intersection via max). The P2S model follows SDFusion's architecture and comprises a shape encoder–decoder pair plus a diffusion model. Both models are trained on the DeepCAD corpus — about 130k CAD models after removing non-renderable shapes, using the official train/validation/test splits. The MPP model is finetuned from Llama3-8b-Instruct with LoRA rank 32, batch 16, 60 epochs on 8 A100-40GB-SXM GPUs, learning rate 5e-4, maximum token length 1024. The P2S model uses the same hardware with total batch size 8, learning rate 5e-5, for 600k steps. Evaluation uses the 2k test set from CAD-Editor, where each item's "edited" parametric sequence is rendered into a voxelized SDF to serve as the target shape and the accompanying textual instructions are discarded; following common practice, 5 outputs are generated per test case.

Why This Matters

Impact on research. The paper defines a task sitting between reverse engineering (which ignores the designer's intent in the original sequence) and prior CAD editing (which ignores visual guidance from a target shape), and it is described as the first application of the test-time-scaling-with-verifiers paradigm to a CAD task. It also demonstrates that pretrained domain models plus inference-time orchestration can substitute for triplet supervision that does not exist.

Real-world applications.

  • Iterative design revision: successive rounds treat the previous output as the new "original", letting engineers refine shapes while preserving the edit history at each round.
  • Simulation- or ergonomics-driven shape changes, where a shape must be adjusted and the parametric sequence kept in sync for manufacturing.
  • Reverse-engineering refinement: a conventional reconstruction pipeline produces a preliminary sequence, and CADMorph refines it together with the target shape for higher fidelity — for example by extending an extrusion height.
  • Manufacturing workflow preservation: because edits stay minimal and semantically faithful (keeping a hole rather than swapping in an arc), downstream fabrication steps remain intact.

Industry relevance. CAD is described as the bridge between a concept and a manufacturable product, and the parametric sequence is the authoritative source for manufacturing. Tools that keep geometry and parameters synchronized address a laborious, error-prone engineering bottleneck.

Future Directions

  • Reduce inference latency. The limitations section names runtime as the first weakness; proposed remedies are accelerating the component models and parallelizing generation and verification.
  • Stronger backbones. The authors plan to pursue stronger P2S and MPP backbones to boost performance.
  • Use CADMorph as a data-generation engine. The conclusion proposes synthesizing the missing triplets to train a fully end-to-end model.
  • Richer benchmarks. The paper notes that CAD-Editor's test set is the only publicly available benchmark suited to CADMorph, and that its CAD models are simpler than real-world assemblies, so a richer, more challenging dataset is needed.

Target Audience

Researchers and practitioners in generative 3D/CAD, CAD tooling, and test-time scaling with verifiers; engineers interested in AI-assisted design workflows; and readers who follow how pretrained domain foundation models can be orchestrated at inference time to avoid scarce supervision. Readers without background in diffusion models, cross-attention, or parametric CAD will find the method sections demanding.

Authors’ abstract

A Computer-Aided Design (CAD) model encodes an object in two coupled forms: a parametric construction sequence and its resulting visible geometric shape. During iterative design, adjustments to the geometric shape inevitably require synchronized edits to the underlying parametric sequence, called geometry-driven parametric CAD editing. The task calls for 1) preserving the original sequence's structure, 2) ensuring each edit's semantic validity, and 3) maintaining high shape fidelity to the target shape, all under scarce editing data triplets. We present CADMorph, an iterative plan-generate-verify framework that orchestrates pretrained domain-specific foundation models during inference: a parameter-to-shape (P2S) latent diffusion model and a masked-parameter-prediction (MPP) model. In the planning stage, cross-attention maps from the P2S model pinpoint the segments that need modification and offer editing masks. The MPP model then infills these masks with semantically valid edits in the generation stage. During verification, the P2S model embeds each candidate sequence in shape-latent space, measures its distance to the target shape, and selects the closest one. The three stages leverage the inherent geometric consciousness and design knowledge in pretrained priors, and thus tackle structure preservation, semantic validity, and shape fidelity respectively. Besides, both P2S and MPP models are trained without triplet data, bypassing the data-scarcity bottleneck. CADMorph surpasses GPT-4o and specialized CAD baselines, and supports downstream applications such as iterative editing and reverse-engineering enhancement.

Read the original paper