CADMAGEDDON: High-Fidelity CAD Reconstruction with Local Inference

Oleg Pavlov, Nikita Gavrilov, Soslan Kabisov, Gennadii Savrasov, Andrey Kuznetsov, Anton Konushin, Dmitrii Zhemchuzhnikov

TL;DR

CADMAGEDDON is an open-source agentic system that reconstructs high-fidelity, editable CAD models from raw triangle meshes. By combining a mid-sized vision-language model (Qwen2.5-Coder-32B, referred to in the paper as Qwen3.8-27B) with precise geometric fitting tools, it outperforms even cloud-based frontier models while running entirely on local hardware like a single GPU or a modern laptop.

What Problem Does This Paper Address?

In engineering, parts are often shared as "dumb" meshes—collections of triangles that lack the feature-level history (sketches, extrusions, holes) required for parametric editing. While engineers need to reconstruct these into editable CAD models, the process is currently manual and tedious.

Existing automated solutions face a "trilemma":

  1. Accuracy vs. Intent: Learned models that generate code in one pass often lack numerical precision, while direct geometric fitting methods often misinterpret the "design intent" (e.g., turning a single complex feature into many tiny, uneditable ones).
  2. Complexity: Most training data consists of simple "sketch-extrude" shapes, causing models to fail on real-world mechanical parts like gears or impellers.
  3. Privacy: Many state-of-the-art systems rely on massive cloud-based APIs (like GPT-4o). For companies working with proprietary designs, uploading sensitive geometry to an external server is a non-starter.

Methods

CADMAGEDDON adopts an agentic approach that separates high-level structural reasoning from low-level geometric precision. Instead of asking a model to guess coordinates, the system uses a loop:

  1. Geometric Instruments: Algorithmic tools analyze the target mesh to detect "named entities"—planes, cylinders, hole patterns, and cross-section levels. These tools fit parameters (like a cylinder's radius) with mathematical precision.
  2. Visual Reasoning: A Vision-Language Model (VLM) acts as the "engineer." It views renders of the mesh and the current reconstruction, then issues commands using the names provided by the instruments (e.g., "extrude profile R0 to level E1").
  3. Iterative Refinement: After each step, the system calculates a "residual"—a visual map of what volume is still missing (green) or what is in excess (red). The agent uses this feedback to add new features or correct previous mistakes.
Figure 1: The CADMAGEDDON agent loop, shown on one real turn of a Fusion 360 run (state 2 to state 3). Qwen3.8-27B issues one command per turn and refers to geometry mainly by name. It orients itself, detects named entities as needed, extracts a profile, builds one feature, and verifies it against the residual (green: missing, red: extra), correcting features when needed. The driver returns the saved state with the smallest residual. Highlighted options are those used in this turn. The residual render was made afterwards for illustration (the agent read it as text), and –split F4 replaces the equivalent value Y=1.4894 that the agent copied from the faces output. Bottom: the part’s feature history. State 1 was redone. The IoU is never shown to the agent.

The system is designed to be lightweight, using FP8 weights to fit the model onto a single 48GB GPU, making local inference viable for most engineering firms.

Datasets

The authors evaluated CADMAGEDDON across five major benchmarks to ensure robustness:

  • DeepCAD & Fusion 360: Standard datasets consisting of human-authored construction sequences.
  • MCB (Mechanical Components Benchmark): A collection of real-world mechanical parts.
  • BenchCAD & BenchCAD-2: Industrial part families designed to test frontier models.
  • CADENA-Bench: A deduplicated corpus used to evaluate surface-level reconstruction quality.

Key Insights and Ideas

  • Tools Over Scale: The researchers found that a mid-sized, locally-run model equipped with the right geometric "instruments" can outperform much larger frontier models that lack specialized CAD tools.
  • Naming is Power: By creating a small grammar for geometric entities (e.g., F# for surfaces, C# for hole stacks), the agent can communicate complex design choices without needing to predict precise floating-point numbers, which is a known weakness of LLMs.
  • Residual-Driven Correction: The ability to "undo" or "replace" features based on visual volume discrepancies allows the agent to recover from early errors, a capability missing in most single-pass reconstruction models.
  • Workflow Integration: Unlike many research projects that output proprietary formats, CADMAGEDDON writes both CadQuery and native FreeCAD code, allowing the results to be dropped directly into existing professional workflows.

Key Results

CADMAGEDDON achieved state-of-the-art results across the board, particularly on complex mechanical parts where surface structure is critical.

Reconstruction quality comparison across five benchmarks, showing CADMAGEDDON leading in IoU and GMS.
  • Superior Accuracy: It reached the highest Intersection over Union (IoU) and Generalized Match Score (GMS) on all five benchmarks. On the MCB dataset, GMS rose from 0.705 (prior best) to 0.818.
  • Beating Frontier Models: On BenchCAD, CADMAGEDDON achieved a 0.991 IoU, surpassing the self-reported scores of frontier models like Claude 3.5 Sonnet (0.963) even when those models were given access to similar tools.
  • Reliability: It significantly reduced the "invalid rate" (parts where the system fails to produce any geometry), leaving at most 0.67% of parts without a reconstruction, compared to ~20% for some optimization-based baselines.

Limitations and Future Work

  • Clean Input Requirement: The system currently assumes a "clean" mesh. It does not yet handle noisy scans from real-world 3D scanners or meshes with missing regions.
  • Single Parts Only: The current iteration focuses on individual parts; reconstructing complex assemblies remains a future challenge.
  • Speed: Because it relies on an iterative loop (30–60 model calls per part), it is slower than single-pass learned models.
  • Design Intent: While the output is editable, the system currently uses literal values for dimensions rather than inferring high-level parametric relationships (e.g., "this hole should always be centered on this face").

Summary updated

Abstract

CAD practitioners often work with proprietary parts that they are unwilling to share with external services. For individuals and small companies, bringing this work in-house also requires computational resources they can afford. We introduce CADMAGEDDON, an open-source agent that reconstructs editable CAD from meshes and can run locally on single-GPU systems and current-generation laptops. The method decomposes this complex task into a chain of simple visual decisions about what to construct and what to correct. Geometric tools support precise construction, allowing the agent to focus on visual reasoning. Using the mid-sized Qwen3.8-27B model, CADMAGEDDON outperforms prior approaches, including systems based on frontier models, in reconstruction quality on all the main benchmarks. CADMAGEDDON integrates with FreeCAD, bringing its reconstructions into practitioners' existing CAD workflows. Code: https://github.com/kulibinai/cadmageddon
BibTeX
@misc{pavlov2026cadmageddon,
  author = {Oleg Pavlov and Nikita Gavrilov and Soslan Kabisov and Gennadii Savrasov and Andrey Kuznetsov and Anton Konushin and Dmitrii Zhemchuzhnikov},
  title = {{CADMAGEDDON: High-Fidelity CAD Reconstruction with Local Inference}},
  year = {2026},
  eprint = {2611.22563},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.22563},
}
Figure