Rust in Everything
← Papers

CADMAGEDDON: High-Fidelity CAD Reconstruction with Local Inference

Oleg Pavlov, Nikita Gavrilov, Soslan Kabisov, Gennadii Savrasov, Andrey Kuznetsov, Anton Konushin et al.

2026-11-18▲ 8arXiv 2611.22563v2Hugging FaceCode

AI-generated from the full paper (deepseek-flash). It may contain mistakes; check the original.

TL;DR

CADMAGEDDON is an open-source, single-GPU mesh-to-CAD agent in which a mid-sized open-weight vision–language model decides feature structure from named geometric entities while fitting supplies the numerical parameters, outperforming prior learned and optimisation-based methods on five benchmarks.

Problem

Engineers often hold geometry only as a mesh, which lacks the feature-level structure and design intent needed for parametric redesign, and manual reconstruction is the current practice. Single-pass learned models run locally but lose much accuracy on real mechanical parts, while direct geometric fitting leaves roughly a quarter of parts without a valid reconstruction. Local execution matters because parts are often proprietary and owners may be unwilling to upload them to an external service. CADMAGEDDON targets accurate reconstruction of real mechanical parts while running on premises on a single machine, without a cluster or external API.

Method

The system takes a triangle mesh of a single part and returns an executable CadQuery program, looping between geometric instruments, a vision–language model, and a program builder. Preprocessing repairs mesh defects, aligns dominant planar face normals with coordinate axes, and rescales very small parts, recording rotation and scale in the emitted program. Instruments analyse the target mesh and the current reconstruction and name entities in a small grammar (levels E/B/K/T, plateaus c, rings R and their lines and arcs, analytic faces F, hole stacks C, helices H, paths W, patterns P, symmetry candidates S, residual bodies D/E and regions M/X), with values obtained by fitting rather than prediction. The model issues at most one command per turn through a command-line interface (overview, survey, spectrum, ortho, section, faces, symmetry, residual, progress, sketch, recall), choosing plane, level, profile primitives and operation. A builder resolves names to fitted values, emits and executes CadQuery code, checks validity, and measures missing and excess volume (the residual) so the next turn either adds a feature or corrects one. The agent uses Qwen3.8-27B with FP8 weights served with vLLM at temperature 0.2; context is managed by truncating earlier reasoning, summarising older command outputs and keeping a bounded number of renders.

Results

  • CADMAGEDDON reaches the highest IoU and GMS and lowest CD on all five benchmarks, with the largest gains on the mechanical-part sets; IoU rises from 0.862 to 0.933 on MCB and from 0.918 to 0.981 on CADENA-Bench. §4.2
  • The largest gains over CADFather are in GMS, the surface-type metric, and Chamfer distance on MCB falls. §4.2
  • CADMAGEDDON leaves far fewer parts without geometry than CADFit, which fails on a large share of DeepCAD, Fusion 360 and MCB. §4.2
  • On the BenchCAD leaderboard, scored with BenchCAD's own 64^3 voxel IoU, CADMAGEDDON reaches 0.991 on a 1000-part subset with 0.3% invalid predictions, above frontier models that receive images and a Python sandbox (up to 0.963) and above the same evaluation of CADFather and CADENA from delivered meshes (0.968, 0.930; CADMAGEDDON 0.995). §4.3
  • On BenchCAD-2 task 3 with mesh input, CADMAGEDDON reaches a part score of 0.933 with CadQuery at 1.05 per part, while the same model in the Qwen Code harness reaches only 0.790 and returns no prediction on 2 of the 23 parts; frontier models on the leaderboard exceed 0.59 at best. §4.4
  • The FreeCAD-emitting agent, using the same instruments, model, call limit and selection, is on par with the CadQuery version and both reach a part score of at least 0.9 on 20 of the 23 parts. §4.4

Limitations

  • The system assumes a clean mesh of a single part: preprocessing repairs cracks and duplicate faces, not scan noise or missing regions, and all benchmarks are derived from CAD models; assemblies and real scans are left to future work (stated in Sec. 5).
  • The instruments bound what the agent can express: a feature no detector names or no operation produces can only be approximated, e.g. 0.7 mm thin walls left out and a part with 51 through-holes of which at most two are built on BenchCAD-2 (stated in Sec. 5).
  • The emitted CadQuery dimensions are literal values rather than named parameters, and fillets and chamfers are explicit solids rather than edge operations, so recovering design intent is beyond the current system (stated in Sec. 5).
  • The comparison with frontier models relies on leaderboard entries differing in input modality and evaluated subsets; a systematic separation of harness, model and modality effects is left to future work, and the agent takes up to 30 or 60 model calls with long contexts, making it slower than single-pass learned models (stated in Sec. 5).

Key points

  • The design splits each feature into structure, decided visually by the model, and numerical parameters, obtained by fitting to the target rather than predicted. §1
  • Instruments name levels, plateaus, rings, analytic faces, hole stacks, helices, paths, patterns, symmetries and residual bodies; names are resolved in the context of the current section, and the model can compose new locations from existing names. §3.2
  • Cross-section polylines are split at corners and decomposed into line and arc segments using a tolerance estimated from mesh tessellation; step changes bracketed by adjacent slices are refined by bisection, and initial slice spacing still limits which changes can be detected. §3.2
  • Residual components smaller than 0.01% of the target volume are excluded from missing and excess totals, and a clean residual requires these fragments to total at most 0.2% of the target volume; an occupancy-based measure replaces the Boolean one for non-closed meshes. §3.4
  • Context is kept within a mid-sized model's window by truncating earlier reasoning, replacing older command outputs with summaries, and keeping a bounded number of recent renders; the model reprints an earlier output in full on 21% of parts. §3.5
  • The driver selects among saved versions by minimizing missing plus excess volume relative to the input mesh, with no ground-truth model used. §3.5
  • Tool use shows the core loop on nearly every part (overview 100%, section 98.3%, sketch 99.95%), extrusion dominating construction (84.8%), with correction common: feature replacement on 29.5% of parts, undo on 14.9%, drop on 6.8%. §A.2
  • Quality grows with call budget: on MCB IoU is 0.814 after 10 calls, 0.896 after 20 and 0.923 after 30, and GMS is still increasing at 60 calls on the mechanical-part sets. §A.1

Mind map

CADMAGEDDON
Problem
Meshes lack feature structure and design intent
Proprietary parts cannot leave premises
Learned models lose accuracy on real parts
Direct fitting leaves many parts invalid
Method
Preprocessing: repair, axis alignment, rescale
Named geometric entities with fitted values
Instruments print reports and renders
Sketch command builds one feature per turn
Residual drives construction or correction
Agent loop with bounded context
Instruments
overview, survey, spectrum, ortho
section, faces, symmetry, residual, progress
Naming grammar: E B K T c R N L A F C H W P S D M X
Implementation
Qwen3.8-27B FP8, vLLM, temperature 0.2
Budgets 30 or 60 commands
Output limit 15000 then 30000 tokens
At most 8 renders per command, 12 kept
Results
Best IoU and GMS on five benchmarks
GMS 0.818 MCB, 0.909 CADENA-Bench
BenchCAD 0.991 voxel IoU
BenchCAD-2 part score 0.933 CadQuery
FreeCAD programs 0.925, on par
Limitations
Single clean part, no scans or assemblies
Detectors bound expressible features
Literal dimensions, no design intent
Leaderboard comparison differs in modality
Many long-context calls, slower