Reverse-Engineering Agent

An agent that rebuilds a 3D CAD part from its 2D PDF drawing: a vision model reads the drawing, generated CadQuery code builds the solid, and a verification layer measures it. Final project of the OpenClassrooms AI Engineer program, run as a scoped proof of concept with its own project-management report.
Problem
When only the drawing of a part exists, a CAD operator rebuilds the 3D model by hand: about 30 minutes for a simple part, up to 2 hours for a complex one (author's estimates). The need was collected in a structured interview with a former technical manager at EFICAD, a CAD software publisher.
Approach
- A 5-hour feasibility spike came first, with success criteria fixed before execution. It returned a go after 2.5 hours.
- The model outputs geometric primitives only. Every derived quantity is recomputed from the produced solid.
- The CadQuery script runs in a Docker sandbox exposed through an MCP server. Success is judged on the STEP file produced, never on the exit code.
- A bounded retry loop stops when there is no error message to pass back, instead of letting the model rewrite blindly.
- Scope held deliberately narrow: extruded outlines, through and blind holes, rectangular pockets, on clean standardized drawings.
Result
- 4 of 5 parts pass all three checks: bounding box, hole count and volume. Both parts held out from development pass on the first attempt.
- On part B, bounding box and hole count were correct: only the volume check caught the geometry error (-9.87%). No single check is sufficient on its own.
- Inference cost: at most $0.19 per part, an upper bound measured on the provider console.
- Main limitation: the three checks need a reference model, so they validate the evaluation, not real use. A reference-free check is the first recommended next step.
Stack
Python, Claude API (vision), CadQuery (OpenCASCADE), Docker, Model Context Protocol, uv.
Documents
- Project-management report (in French): needs analysis, audit, target solution, implementation strategy and project control. It is the full case study.
- Source repository, release v0.1.0.