Dataset pipeline, geometric scorer, and verifiers-environment core for 2D-technical-drawing → 3D-CAD reconstruction
Project description
cadrecon
An RL environment and evaluation harness for a task frontier models are measurably bad at: reconstructing a 3D CAD solid from a 2D technical drawing plus sparse specs.
An agent under test receives orthographic drawing views (a rasterized PNG,
plus optionally the vector DXF) and a small spec table, and writes free-form
build123d Python in a hardened Docker sandbox to construct the part. It
submits a STEP file, which is scored geometrically against a ground-truth
STEP file. The interesting signal is in the execute-then-score loop over
direct geometry code — not in regressing a mesh.
Design in one screen
- Direct geometry over program synthesis. The action space is free-form
build123dPython, executed turn-by-turn in a sandboxed container (run_python(code)/submit()); ground truth is the solid, not any particular code, since many programs yield the same shape. (An earlier custom CAD DSL/interpreter was removed in favor of this sandboxed-code action space.) - Dense, geometry-grounded reward. Exact-match rewards don't train. The scorer gives partial credit via continuous geometric similarity (Chamfer distance, tolerant volumetric IoU, F-score) plus a validity term.
- Real distribution, not synthetic inverses. Data comes from purpose-built CAD-ML research datasets — DeepCAD, ABC, and Fusion 360 Reconstruction — the standard benchmarks for this direction. Raw third-party CAD files stay out of the repo; a loader script fetches them locally.
Install
uv sync --all-packages # core (loaders, task builder, scorer, CLI) + the
# environments/cadrecon_env workspace member (the
# verifiers RL/eval environment); a bare `uv sync`
# only installs the root package and the env import
# fails
uv sync --extra data # + real DeepCAD source fetch (gdown)
CLI
cadrecon is the single entry point. Every subcommand runs offline.
uv run cadrecon --help
| Command | What it does |
|---|---|
build |
Load raw loader-format sample files (DeepCAD JSON / ABC STEP) and build a task set (drawings, specs, target STEP + mesh) + manifest |
render |
Project a STEP solid to a multiview DXF, and rasterize it to a PNG |
score |
Score a candidate STEP against a target and print the full breakdown |
validate |
Re-check a built manifest.jsonl against the committed JSON Schema |
data fetch |
Bounded, resumable, polite download of a registered dataset source |
data build |
Build a task-set corpus at scale, from DeepCAD JSON models (--input) or any directory of raw STEP files (--from-step-dir, BYO CAD vault) |
data generate |
Generate a corpus of procedurally-generated, distribution-matched training tasks |
data coverage |
Parse-coverage report over a directory of DeepCAD JSON models |
data stats |
Compute corpus-wide statistics used as the data generate reference distribution |
Layout
src/cadrecon/
loaders/ DeepCAD / ABC -> common CadModel
task/ builder: CadModel -> drawings + specs + ground-truth STEP/mesh
kernel/ geometry kernel (build123d) behind a stable interface
sandbox/ hardened Docker sandbox that runs agent-submitted build123d code
scoring/ Chamfer / tolerant-IoU / F-score / validity + reward assembly
scorer.py candidate-vs-target scoring entry point
data/ dataset build, generation, BYO import, coverage, stats, splits
cli.py operator entry point
environments/
cadrecon_env/ the `verifiers` environment package (cadrecon_env.py) that
wraps the sandbox + scorer into a multi-turn RL/eval env,
runnable via `vf-eval cadrecon-env`
docker/
sandbox/ Dockerfile for the cadrecon-sandbox image the env runs code in
configs/ vf-eval endpoint config (endpoints.toml)
scripts/ sandbox image build, live smoke test (vf-eval), results summary
schema/ cadrecon_manifest.schema.json
docs/ spec, design report, reward red-team, phase plans
tests/ offline test suite (no live network anywhere)
Tests
uv run pytest
The suite is fully offline (R-TST-1): loaders, fetch, and network paths run
against mocked transports and kernel-authored fixture solids
(tests/cadrecon_conftest.py), so no dataset download is required.
Docs
docs/specs/cadrecon-spec.md— the spec.docs/cadrecon-design-report.md— design rationale and the project's origin.docs/data-card.md— dataset sources, licensing posture, and split policy (real data for eval, real + generated for train).docs/reward-redteam.md— adversarial analysis of the reward surface.docs/superpowers/plans/— phased implementation plans.
Status
The reusable artifact is the verifiers environment (environments/cadrecon_env)
plus the dataset pipeline and geometric scorer it wraps. environments/cadrecon_env/README.md
covers the environment's observation/action/reward contract and arguments;
scripts/live_smoke.sh runs the end-to-end acceptance path (vf-eval cadrecon-env against a real model). Not a training-loop deliverable itself —
training happens by pointing an RL trainer at the verifiers/Hub environment.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cadrecon-0.1.0.tar.gz.
File metadata
- Download URL: cadrecon-0.1.0.tar.gz
- Upload date:
- Size: 114.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db6e78f5b1f919f43205111b42930bcffad267eeaab424dbfb124cd31f60fd0d
|
|
| MD5 |
2fda1c9150fd8714ed9a8e097bb5040e
|
|
| BLAKE2b-256 |
e0fa448b63c67788ab3179b9d6d81dd0040112dc815ea04e4bc7d3745942c7d3
|
File details
Details for the file cadrecon-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cadrecon-0.1.0-py3-none-any.whl
- Upload date:
- Size: 135.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c2d5d6929e47b06f6ccdaebafe1a014c0b76a8f1fe003c36a36980cdca85f31
|
|
| MD5 |
0e58e94832875f0f216f9589720d5435
|
|
| BLAKE2b-256 |
d4cd14a93c846ab9c1861da9278ab920347414c800d7b59155796a4cf2ac9ba5
|