Papers
CADMAGEDDON: High-Fidelity CAD Reconstruction with Local Inference
Engineers often receive mechanical parts only as meshes — exports from legacy systems or files stripped of their feature tree by a supplier — which cannot be parametrically redesigned or easily…

- arXiv
- 2611.22563 · Preprint · not peer-reviewed
- Published
- 2026-11-17
- Authors
- Oleg Pavlov, Nikita Gavrilov, Soslan Kabisov, Gennadii Savrasov, Andrey Kuznetsov, Anton Konushin, Dmitrii Zhemchuzhnikov
In plain words
Engineers often receive mechanical parts only as meshes — exports from legacy systems or files stripped of their feature tree by a supplier — which cannot be parametrically redesigned or easily edited.
AI summary
Overview
Research area: Artificial intelligence for computer-aided design (CAD) — specifically mesh-to-CAD reverse engineering with vision–language-model agents.
Technical level: Advanced. The paper assumes familiarity with boundary representations, CadQuery scripts, volumetric IoU, Chamfer distance, and LLM agent harnesses, though its central idea (separate what to build from how big it is) is easy to grasp.
Scope: The paper introduces CADMAGEDDON, an open-source agent that reconstructs editable, feature-based CAD programs from triangle meshes using a single mid-sized open-weight model (Qwen3.8-27B) running on local hardware, and evaluates it against learned, optimisation-based, and frontier-model baselines on six benchmark suites.
What This Paper Is About
Engineers often receive mechanical parts only as meshes — exports from legacy systems or files stripped of their feature tree by a supplier — which cannot be parametrically redesigned or easily edited. CADMAGEDDON's goal is to automatically rebuild such a part as an executable, editable CAD program (sketches, extrusions, revolutions, holes) that runs on a single GPU on premises, so that proprietary geometry never has to leave the owner's machine. The key move is to split every feature into two halves: a vision–language model decides the structure (which plane, which profile, which operation), while geometric fitting supplies the numerical values.
Key Contributions
-
A named-entity action space grounded in the target mesh. Geometric instruments detect and name the entities the model needs — cross-section levels, fitted lines and arcs, rings, analytic surfaces, hole stacks, helices, sweep paths, patterns, symmetries, and residual missing/extra bodies — and the model acts primarily by referring to these names rather than by writing coordinates.
-
A structure/parameter split for every feature. Unlike learned single-pass models that predict all values, and unlike direct fitting that guesses the operation sequence, CADMAGEDDON has the model choose only the structure while fitting resolves the names to precise values measured on the target.
-
A working agent with no trained reconstruction model, generator, optimiser, or candidate pool. With Qwen3.8-27B at FP8 precision it fits on a single 48 GB GPU, runs on 30 commands (DeepCAD, BenchCAD) or 60 commands (Fusion 360, MCB, CADENA-Bench), and selects its own output by minimising missing plus excess volume — no ground-truth model is used.
-
Two output back-ends plus an open-source release. The agent writes both CadQuery programs and native FreeCAD PartDesign programs through its own DSL, so reconstructions enter existing FreeCAD workflows directly; code is released at github.com/kulibinai/cadmageddon.
Main Findings
-
Best results on all five main benchmarks. CADMAGEDDON reaches IoU / GMS / CD (×10³) / invalid rate of 0.999 / 0.991 / 0.128 / 0.00 on DeepCAD (300 parts), 0.993 / 0.973 / 0.112 / 0.33 on Fusion 360 (300), 0.933 / 0.818 / 0.196 / 0.67 on MCB (300), 0.999 / 0.975 / 0.137 / 0.30 on BenchCAD (1000), and 0.981 / 0.909 / 0.172 / 0.00 on CADENA-Bench (60).
-
The margin grows on real mechanical parts, and is largest in surface structure. Against the strongest baseline, CADFather (which runs the same frozen Qwen3.8-27B), IoU rises from 0.862 to 0.933 on MCB and from 0.918 to 0.981 on CADENA-Bench, while GMS rises from 0.705 to 0.818 and from 0.800 to 0.909 under the same evaluation. Chamfer distance on MCB falls from 0.260 to 0.196.
-
Robustness to failure. CADMAGEDDON leaves at most 0.67% of parts without geometry, whereas CADFit fails on 18.7–24.3% of DeepCAD, Fusion 360 and MCB (23.00, 18.67 and 24.33 respectively), and StepCAD trails substantially on every benchmark it was run on.
-
Above self-reported frontier entries on BenchCAD. On a 1000-part subset scored with BenchCAD's own 64³ voxel IoU, CADMAGEDDON reaches 0.991 with 0.3% invalid predictions, versus up to 0.963 for frontier models given images plus a Python sandbox (Claude Sonnet 5.5 with tools), 0.747 without tools, and 0.968 for CADFather. Scored from the delivered meshes on the same 1000 parts it reaches 0.995, against 0.968 for CADFather and 0.930 for CADENA. The authors caution that inputs and subsets differ across leaderboard rows.
-
Instruments, not model scale, carry much of the accuracy. On BenchCAD-2, task 3 (23 parts), CADMAGEDDON scores 0.933 with CadQuery at $1.05 per part, while the same Qwen3.8-27B in the general-purpose Qwen Code harness reaches only 0.790, returns no prediction on 2 of 23 parts, and needs about 18M input tokens per attempt. Frontier models on the BenchCAD 2.0 leaderboard for this task do not exceed a part score of 0.59.
-
Native FreeCAD output is nearly as good as CadQuery. The FreeCAD PartDesign variant scores 0.925 versus 0.933 for CadQuery under the same model, call limit and selection, and both reach a part score of at least 0.9 on 20 of the 23 parts.
-
Correction is a routine part of the loop. Across 1983 parts and 24 476 calls, the agent replaced a feature it had built on 29.5% of parts, undid one on 14.9%, and dropped one on 6.8%; core instruments dominate usage (overview 100%, section 98.3%, sketch 99.95%), while faces, ortho and residual are used on 52.3%, 49.8% and 29.7% of parts.
-
Budget matters more for mechanical parts. The best program within 10 calls already reaches IoU 0.980 on DeepCAD and 0.966 on BenchCAD, but MCB reaches 0.814 at 10 calls, 0.896 at 20 and 0.923 at 30, and CADENA-Bench reaches 0.849, 0.953 and 0.971; GMS is still rising at 60 calls on both sets.
Methodology in Plain English
The system takes a triangle mesh of one part and returns a CadQuery (or FreeCAD) program. Before anything else it repairs the mesh, rotates the dominant planar face normals onto the coordinate axes, and rescales very small parts, recording the transform so geometry can be mapped back to the input frame.
Then a set of geometric "instruments" analyses the mesh and gives the useful quantities short, stable names. The model can ask for an overview (isometric and orthographic renders plus size, volume, body count, helices, revolve axis, and a heuristic regime such as helical, revolved, prismatic, patterned or freeform), a survey of which principal plane is most prismatic, a spectrum of constant-cross-section intervals along a plane normal, elevations marking named levels, a cross-section decomposed into named rings, lines and arcs, a list of analytic faces and coaxial hole stacks, detected mirror and rotational symmetries, and a residual splitting the difference between target and current reconstruction into named missing and extra bodies. Values behind those names come from classical fitting — corner splitting, recursive line/arc decomposition, bisection to refine step locations, surface growing with tolerances derived from tessellation — not from the language model.
The model then makes one decision per turn: a single sketch command naming a plane, a level, the primitives forming the profile, an operation (extrusion, optionally tapered or symmetric; revolution; loft including twisted lofts; sweep along a helix or detected path; holes along a detected stack; blends), and optionally where the operation ends. A builder resolves the names to fitted numbers, emits and executes CadQuery, checks validity, and reports how much material is missing or in excess. If a needed location has no detector name, the model can compose one from existing names — the midpoint of two vertices, for instance. Rendering with a shared colour convention (green for missing, red for extra) lets the model see progress when a picture helps.
Context management keeps the conversation inside a mid-sized model's window: earlier reasoning is truncated, older command outputs are replaced by summaries after 4 commands, and only a bounded number of recent renders is kept (at most 12, from the 6 most recent image-producing commands), with a recall command to reprint an old output in full (used on 21% of parts). When the model says DONE, the driver pushes back once per saved version if mismatched patches still cover at least 1% of the target surface, and the final answer is the saved version with the smallest missing-plus-excess volume. An important detail: the IoU is never shown to the agent.
Why This Matters
Impact on research. The paper argues that the bottleneck in mesh-to-CAD is not model scale but the interface between the model and the geometry. By showing that a 27B open-weight model with target-grounded tools outperforms frontier models with a generic code sandbox on the same task family (0.933 versus at most 0.59 part score on BenchCAD-2 task 3), it reframes agentic CAD as a problem of instrument design rather than raw capability. It also gives the field a second use for GMS alongside IoU, exposing a surface-structure gap that volume metrics hide.
Real-world applications:
- Rebuilding editable feature trees for legacy parts that survive only as mesh exports.
- Recovering design intent from supplier-provided meshes that have been stripped of their feature history.
- Reverse-engineering replacement or repair parts in-house without uploading proprietary geometry to an external service.
- Feeding reconstructions directly into FreeCAD workflows for modification, jigs, fixtures, or tooling.
Industry relevance. For individuals and small companies, the appeal is twofold: the data never leaves the premises, and the hardware requirement is a single 48 GB GPU with FP8 weights rather than a cluster or a paid API. The reported cost of $1.05 per part at OpenRouter prices, and the ability to deliver native FreeCAD models, make the approach practical rather than demonstrative — although the authors are explicit that interaction (up to 30 or 60 model calls with long contexts) makes it slower than single-pass learned models.
Future Directions
-
Beyond clean single-part meshes. Preprocessing currently repairs cracks and duplicate faces but not scan noise or missing regions, and every benchmark is derived from CAD models; assemblies and real scans are left to future work.
-
Wider instrument coverage. The instruments bound what the agent can express: a feature no detector names or no operation produces can only be approximated. The reported examples are 0.7 mm walls of one BenchCAD-2 part that every attempt leaves out and a part with 51 through-holes where at most two are built.
-
Recovering design intent, not just geometry. The emitted CadQuery is editable, but dimensions are literal values rather than named parameters and fillets and chamfers are explicit solids rather than edge operations.
-
A controlled comparison against frontier models. The current comparison relies on leaderboard entries that differ in input modality and evaluated subset; separating the contributions of harness, model and input modality is deferred, and the authors note the cost grows quickly with the number of models, harnesses and benchmarks.
Target Audience
Researchers and engineers working on CAD reverse engineering, generative CAD, and tool-using vision–language agents; practitioners who need on-premises, privacy-preserving reconstruction of proprietary parts; and developers building agent harnesses, who will find the named-entity action space, the context-budgeting scheme, and the residual-driven stopping rules the most transferable parts of the design. Readers focused on parametric feature recognition or on scan-to-CAD from noisy real-world data will find the stated limitations more relevant than the headline numbers.
Authors’ 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…
The full abstract on arXivRelated papers
- CADFather: Autonomous CAD Reconstruction through Coordinated Tool Use 2026-10-06 · cs.AI · Also by Andrey Kuznetsov, Anton Konushin +4
- MillBill: A Machining Agent with Geometric Feedback 2026-11-17 · cs.AI · Also by Andrey Kuznetsov, Anton Konushin +3
- EgoEMS: A High-Fidelity Multimodal Egocentric Dataset for Cognitive Assistance in Emergency Medical Services 2025-11-13 · cs.AI · Key terms of the title in common
- Evolution in Simulation: AI-Agent School with Dual Memory for High-Fidelity Educational Dynamics 2025-10-13 · cs.AI · Key terms of the title in common
- Bits or permutations? Spending a fixed inference budget on weight precision or on option-order averaging in small local language models 2026-11-10 · cs.AI · Key terms of the title in common