Skip to main content

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 build123d Python, 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

cadrecon-0.1.3.tar.gz (130.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cadrecon-0.1.3-py3-none-any.whl (156.3 kB view details)

Uploaded Python 3

File details

Details for the file cadrecon-0.1.3.tar.gz.

File metadata

  • Download URL: cadrecon-0.1.3.tar.gz
  • Upload date:
  • Size: 130.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.18

File hashes

Hashes for cadrecon-0.1.3.tar.gz
Algorithm Hash digest
SHA256 48f236bcbd32d28279fedacef55cae310510545d34dd9edd22611f5580f2c94a
MD5 0847db86f761740f9e9e6f066ed21b0a
BLAKE2b-256 f257567381199ff4a2d34dd24505ff9a189f24c51b780021fded21f529db459f

See more details on using hashes here.

File details

Details for the file cadrecon-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: cadrecon-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 156.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.18

File hashes

Hashes for cadrecon-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d17af2d4c2e25c04441b6f9b63058cf53ab52a9ddde7068d9ba22e2d2fe208cc
MD5 c3051e94da45e4d9d4c23407081c70b1
BLAKE2b-256 38f3ff88fcf0f4ba221c0b1e3422831161e16ea5452b6dbc36368134e009426d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page