TimelineCAD thread · rev E2026

Abra-CAD: Geometry-Guided Reconstruction of CAD Solids and Construction Programs

The problem

Parts often reach an engineer with no design history: a scan, a supplier's mesh, an old drawing. Each shows the final shape and none of the steps that built it, so changing one feature means remodelling the part by hand. A senior design engineer told me this conversion is slow and the geometry it gives is poor.

Role
First author
With
Prof. Ramanathan Muthuganapathy
Lab
AGC Lab, IIT Madras
Status
Under review
The explainer, 4 min 27 s, with synthesized narration. Every 3D part in it is geometry from the paper's own runs.

The idea

A B-rep already holds most of the numbers a program needs: a face outline can be an extrusion profile and a cylindrical face a hole. So we read candidate tools off the faces and search only for which to combine, and in what order. Meshes and point clouds are first rebuilt into a B-rep, and drawings are carved from their three views.

1The idea

A STEP file keeps a part's exact boundary but not the operations that built it, and a mesh or scan keeps even less. Recent methods train large code generators to predict both the operations and their numbers. A boundary representation, or B-rep, already holds most of those numbers: the outline of a planar face can serve as an extrusion profile, another face fixes its depth, and a cylindrical face gives a hole. The construction sequence is missing, but the geometry of its tools is already there.

So Abra-CAD reads candidate tools straight off the faces (extrusions, holes, revolves, fillets, chamfers, shells and patterns) and searches only for the discrete choices: which tools to use, which Boolean to apply, and in what order. A program counts as exact when its solid matches the target to within 10−5 in volume IoU. It does not have to match the original history, since many programs build the same solid.

From an observation to a CadQuery program. Meshes and points are rebuilt into a solid (2, 3), tools are read off its faces or straight off a B-rep (4), and a search finds the program (5). A drawing is carved from its views. Every route ends in a program that is replayed and checked against the input (6). Grey boxes are analytic or kernel steps; tinted boxes are learned models with their parameter counts.
Fig. 1From an observation to a CadQuery program. Meshes and points are rebuilt into a solid (2, 3), tools are read off its faces or straight off a B-rep (4), and a search finds the program (5). A drawing is carved from its views. Every route ends in a program that is replayed and checked against the input (6). Grey boxes are analytic or kernel steps; tinted boxes are learned models with their parameter counts.

2Two searches over the same tools

Boolean search. Building every combination of tools in the CAD kernel would be far too slow. Instead, each tool is tested once on probe points: 1,024 random points in the part's bounding box, plus pairs just inside and just outside each face. Joining two tools is then an OR of their masks and a cut is an AND with a NOT, so a beam search can score hundreds of thousands of candidates without building a solid. Only the best are replayed in the kernel. On the training part in the figure below, 859,052 candidates were scored on points and a single six-operation program was replayed, exactly.

A learned policy. When that search misses, a 2.74M-parameter graph transformer looks at the target and the solid built so far and proposes the next action. It first imitates synthetic Zero-to-CAD programs, then improves by expert iteration: for 30 rounds it searches new parts and learns from the exact programs it finds. Candidate programs are tried in order of their code length under the policy, the number of bits it needs to describe them. On the part below, training cut that cost from 84 bits to 5.

Two searches using the same face-derived tools. Boolean search scores 859,052 candidate combinations on probe points and replays one program in the kernel (1). The policy proposes one action at a time (2), is trained by expert iteration (3), and finds a different exact program at its 30th kernel call (4).
Fig. 2Two searches using the same face-derived tools. Boolean search scores 859,052 candidate combinations on probe points and replays one program in the kernel (1). The policy proposes one action at a time (2), is trained by expert iteration (3), and finds a different exact program at its 30th kernel call (4).

3Meshes, point clouds and drawings

A mesh or point cloud has no faces to read, so it is first rebuilt into a B-rep. Planes, cylinders, cones, spheres and tori are fitted wherever the samples support them, and two small networks (11.7M and 11.8M parameters) propose the surfaces that fitting misses. Every surface is extended across a box around the part, a graph min-cut labels the resulting cells as material or empty, and the material cells are fused into a solid that enters the same search. When the search cannot match the input, a fallback slices the mesh into stacked cross-sections and extrudes them, which still gives a program that runs.

A drawing follows its own route. Each view's outline is extruded along its viewing direction and the extrusions are intersected; closed regions in a view become cuts, with depths read from the other views; and a 1.67M-parameter network corrects the carve from the drawn lines.

4Results on 748 ABC parts

102 vs 4parts rebuilt exactly from meshes: Abra-CAD against the best of the other methods. Given the B-rep, 403
0.864mean normalized volume IoU from meshes, against 0.672 for CADENA. Search alone: 0.648
17.2Mlearned parameters on the mesh route, against 0.3B to 2.21B for the mesh baselines

From meshes, the search alone reaches 0.648 mean volume IoU, just under CADENA's 0.672. The section-stack fallback, which covers the parts the search cannot match, raises it to 0.864. Stacked sections run, but they are harder to edit than a feature program, so the count of exact rebuilds is the stricter measure and the one I lead with. From drawings, the programs reach 0.744 against 0.334 for Ortho2CAD-RL. From point clouds the baselines are close: cadrille-RL reaches 0.641 to our 0.609, though ours covers more of the surface.

How the comparison was run

  • Parts. Every method rebuilds the same 748 single-solid ABC parts, each from its own kind of input.
  • Baselines. We ran each baseline ourselves on these parts. The scores are from our runs, so they can differ from the numbers in the original papers, which were measured on other test sets.
  • Scoring. Every output program is replayed in the CAD kernel and compared with the reference solid. IND is volume IoU after normalizing both solids, averaged over all 748 parts, and a program that fails to run or build scores zero.
  • Inputs. The point-cloud baselines take 256 points, as they were built to; ours takes 8,192 oriented points. Parameter counts marked * are for the backbone only.
Programs from every input on the same 748 ABC parts. The point baselines get 256 points, ours 8,192 oriented points. IND: mean normalized volume IoU. OSC: oriented surface coverage. FeatR95: share of recognized features kept. Exact: volume IoU within 10−5 of the reference. *Backbone only. The B-rep route has no fallback, so parts it cannot rebuild exactly lower its mean IND below the mesh route's.
InputMethodParamsINDOSCFeatR95Exact
pointsCAD-Recode v1.51.54B.482.188.0503
pointscadrille-RL2.21B.641.208.0641
pointsAbra-CAD17.2M.609.320.0580
meshCADENA2.21B.672.392.1734
meshStepCAD1.55B*.546.213.0854
meshCADFit0.3B*.444.445.3260
meshAbra-CAD17.2M.864.793.731102
drawingOrtho2CAD-RL8.77B.334.069.0050
drawingAbra-CAD1.67M.744.449.1320
B-repAbra-CAD2.7M.736.789.751403

Exact programs from B-reps

Given the B-rep, Abra-CAD also rebuilds 1,492 of the 1,725 Fusion 360 Gallery test designs exactly within 100 kernel evaluations (86.5%), against 67.5% reported for the published Gallery agent in its own environment. Boolean search, with no learned parameters, accounts for 1,431 of them; the trained policy adds 61. On CADBench's four 3,000-design splits it finds 2,930 exact programs on DeepCAD, 1,968 on Fusion 360, 2,499 on ABC Extrude and 1,391 on ABC All-Ops. The drop on All-Ops shows where the supported tools run out.

5Volume overlap is not enough

A program can overlap its reference almost perfectly and still get the details wrong. On one part, removing a 0.2 mm chamfer leaves volume IoU at 0.99994. So we also measure surfaces. Oriented surface coverage samples each patch of the reference and checks that the output has surface nearby, facing the same way, and small patches count as much as large ones; the same missing chamfer drops it to 0.704. A feature such as a hole or fillet counts as kept only when all of its faces are covered. In the table, cadrille-RL reaches 0.641 IND but only 0.208 coverage and 0.064 feature retention.

Programs from every input on single-solid ABC parts, from 13 to 386 faces. Reference faces are coloured by feature, and an output keeps a feature's colour only where every face of it is covered. Failed outputs count as zero.
Fig. 3Programs from every input on single-solid ABC parts, from 13 to 386 faces. Reference faces are coloured by feature, and an output keeps a feature's colour only where every face of it is covered. Failed outputs count as zero.

6Limits

Exact recovery depends on the tools that can be read off the faces. Extrusions, revolves and finishing operations cover many mechanical parts, but freeform geometry remains hard. A program that rebuilds the shape need not match the designer's original history or constraints, and a section-stack fallback runs but is harder to edit than a compact feature program.

7Paper

A. Bharathi, R. Muthuganapathy. Abra-CAD: Geometry-Guided Reconstruction of CAD Solids and Construction Programs. Under review.