Computational design
I can't draw CAD from scratch, but I can usually find a downloaded mesh close to what I need.
Agents rebuild that mesh into a real editable solid, and I make my changes from there.
The problem
A mesh is a shell, not a shape
A downloaded mesh looks like the part you want and behaves nothing like it. It is a skin of triangles with no idea that it has a hole in it, or a flat face, or a fillet. There is nothing in it to grab and resize, because there is no feature there to grab. Turning one into a real solid by hand is exactly the skill I don't have.
So the rebuild is the product: agents work the mesh back into a solid with real faces and edges, and from there it behaves like something drawn on purpose: resize it, drill it, add a bracket, and export STEP for a vendor or a print-ready 3MF for the printer downstairs.
The rebuild
Cheapest method that works, then fall back
There is no single conversion that handles every mesh. The fast methods work beautifully on parts that were mechanical to begin with and produce garbage on anything organic. The thorough methods handle almost anything and are slow enough that you would never run one speculatively.
So the pipeline tries them in order, cheapest first, and falls back when a tier fails its check rather than when it errors. Most parts never reach the expensive tier. The ones that do are the ones that needed it, and I find out which is which from the operation log rather than by guessing.
The check
Measured against the mesh it came from
A rebuilt solid that looks right and is a millimetre off is worse than one that obviously failed, because you find out at the printer or, later, at the vendor.
Every rebuild is compared back against the original mesh before it is accepted, and the comparison is what promotes or rejects the tier. The bench scores two different things: how close the solid is to the mesh it was rebuilt from, and, for the parts where a real STEP solid exists to check against, how close it is to that. On a four-part test bench, the strongest rebuild matches its source mesh to 99.6%. Running a published neural rebuild, CAD-Recode, over the same four parts topped out at 84.8%, and it scored 30.2% on the part my pipeline rebuilds to 99.6%.
Rebuilt solid against the mesh it came from
0.996
IoU on the vent panel through the extrusion tier, its 16 mounting holes recovered as editable features
The ladder stopped at the sew. The two tiers below ran for the bench table only, and both scored worse after costing more. The check is an IoU floor, added after a tier once reported success at 0.134.
One bench row: run a tier, then measure it
def bench_recon_row(fname, tier, gt_mesh):
p = _make_part(fname)
base_mesh = p.mesh.copy()
t = time.time()
ok, err, out = True, "", None
try:
if tier == "recon":
r = recon_fn(p)
ok = bool(r.ok)
out = p if r.ok else None
if not r.ok:
err = str(r.reason)[:48]
elif tier == "tier2":
forge.convert(p)
out, ok = p, p.has_solid
elif tier == "cadfit":
from forge.recon_cadfit import reconstruct_cadfit
out = reconstruct_cadfit(p, max_iterations=1)
ok = out.has_solid
elif tier == "neural":
from forge.recon_neural import reconstruct_neural
out = reconstruct_neural(p, device="cuda")
ok = out.has_solid
else:
raise ValueError(f"unknown tier {tier!r}")
except Exception as e:
ok = False
err = f"{type(e).__name__}: {str(e)[:48]}"
dt = time.time() - t
faces = holes_n = vol = iou_self = iou_gt = "-" # table placeholders
if out is not None and out.has_solid:
faces = count_faces(out.solid)
holes_n = len(forge_solid_holes(out))
vol = int(round(forge.solid_volume(out.solid)))
om = out.display_mesh()
iou_self = voxel_iou(om, base_mesh) # vs the mesh it was rebuilt from
if gt_mesh is not None:
iou_gt = voxel_iou(om, gt_mesh) # vs the STEP solid, where one exists
md(f"| {tier} | {('OK' if ok else 'FAIL')} | {dt:.1f} | {faces} | "
f"{holes_n} | {vol} | {iou_self} | {iou_gt} | {err} |")
Where it stands
Runs live in the browser. On a four-part test bench, the strongest rebuild matches its source mesh to 99.6%. Running a published neural rebuild, CAD-Recode, over the same four parts topped out at 84.8%.
mesh in, STEP/3MF out · agents drive the rebuild · live viewer