cad-image-to-3d
A Claude Code skill that turns CAD drawing images (2D orthographic views) into 3D models (editable CadQuery code and STEP) and loads them into Unity as a ready-made scene, entirely from the command line.

3-view drawing ──► Claude writes CadQuery ──► re-draws its own model and compares
──► feature audit (counts holes, slots, teeth...) ──► STEP
──► mesh (Y-up, metres) ──► Unity CLI: import into your project → layout scene
Why
Engineering intent still travels as 2D drawings. This skill reconstructs the 3D part as
CadQuery code (editable, parametric) and STEP, checks itself the way an engineer would,
and loads the parts into Unity without anyone opening the Editor.
- Self-refinement loop. It follows the inference-time self-refinement protocol from the
Ortho2CAD paper: one-shot code → fix execution errors →
render the model back into a 3-view drawing with the benchmark's own renderer → compare with
the input → revise (twice) → pick the best candidate from the drawings alone.
- Feature audit. A visual comparison barely notices a missing row of rivet holes, so every
case ends with an audit: the agent lists every hole, slot, notch, tooth and edge treatment
the drawing shows, with counts and patterns, cross-checks hole counts with an automatic
circle/dot counter (
scripts/features.py), compares the list with the final model and adds
whatever is missing in an extra stage (loop3). Findings go into audit.md and log.md.
- Real-world drawings. Besides benchmark-style 3-views it handles figures from handbooks,
manuals and shops: third-angle views, a profile view plus an isometric picture, plan views
with removed sections, dimension tables, notes such as
.050 THK or 12X ⌀.144 THRU, and
missing dimensions. Every assumed value is logged with its evidence.
- Batch. A folder of drawings is split across parallel subagents.
- Scoring. With ground-truth STEP files it reports the official Ortho2CAD IoU, a
scale-preserving IoU and bounding-box error.
- Unity, from the CLI. The parts land in your own project (or a new URP project it creates)
at real scale, with a scene that lays them out on a labelled grid. An optional URP preview
renders stills so you can check the result without opening the Editor.
Results
On all 300 drawings of the official Ortho2CAD test set (100 each from DeepCAD, Fusion 360
Gallery and ZeroToCAD1m). This skill was run with Claude Opus 5.5; the last row is the best
result reported in the Ortho2CAD paper, which used GPT 5.5 with the same self-refinement loop:
| DeepCAD | Fusion360 | ZeroToCAD | All |
|---|
| This skill, one-shot (Claude Opus 5.5) | 0.921 | 0.892 | 0.836 | 0.883 |
| This skill, after self-refinement (Claude Opus 5.5) | 0.935 | 0.905 | 0.891 | 0.910 |
| Ortho2CAD paper's best (GPT 5.5, self-refinement) | 0.846 | 0.817 | 0.726 | – |
Mean official IoU (1.0 = identical). 100% of outputs are valid CAD; 283/300 match the overall
dimensions within 1%. Same test set and scoring code as the paper, but the loop is a
reproduction run by Claude agents, not the paper's API script. The official IoU normalizes
scale (size errors are invisible to it; the bounding-box check covers that) and under-scores
symmetric parts whose principal axes are degenerate (pyramids, nuts).
These numbers were measured without the feature audit, which is not part of the paper's loop;
the skill skips the audit when asked to reproduce them.

The three drawings above, their ground truth and the code the skill wrote are in
examples/. See Reproduce the figure.
Install
As a plugin (recommended)
/plugin marketplace add skykim/cad-image-to-3d
/plugin install cad-image-to-3d@cad-image-to-3d
Or manually: copy skills/cad-image-to-3d/ to ~/.claude/skills/cad-image-to-3d/.
Then, once per machine, let Claude run (or run yourself):
bash skills/cad-image-to-3d/scripts/setup_env.sh
It creates a conda-forge environment (CadQuery, pythonOCC, cairosvg) under
~/.cache/cad-image-to-3d (or $CAD_IMAGE_TO_3D_HOME), clones the Ortho2CAD renderer at a
pinned commit and runs a smoke test.
Requirements: micromamba / mamba / conda, git · for Unity: a Unity 6 editor installed via
Unity Hub (its URP template is used when a new project is created) · macOS tested
(Windows / Linux paths are handled but untested).
Use
Just ask Claude, for example:
Convert the 3-view drawings in ./drawings to STEP. Ground-truth STEP files are in ./gt, so score them too.
Turn these drawings into CAD and load them into my Unity project at ~/Projects/Factory. They are in mm.