You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

ortho2cad

Orthographic engineering drawings -> CadQuery code. A vision-language training set pairing the drawings of Ortho2CAD (2026) with the code of GenCAD-Code (2025), with deduplicated, leakage-free train / test / val splits.

input    800x800 orthographic three-view drawing (Front / Top / Right;
         hidden edges dashed; bounding-box dimensions annotated)
output   a CadQuery (Python) program that builds the corresponding 3D solid

Behind every record is a real modelling operation performed by a human on Onshape. The whole chain is deterministic: the drawings come from exact hidden-line-removal geometry, the code from a rule-based converter. No step of it is AI-generated -- no synthesis, no LLM, no hallucination.

Size

split records shards
train 108,343 5
test 5,105 1
validation 5,330 1
total 118,778 7

Across the three splits: zero code overlap, zero part-id overlap, zero duplicates within a split. None of that is true of the upstream splits -- see "How the splits were made" below.

Quick start

from datasets import load_dataset
import json

ds = load_dataset("AI4Manufacturing/ortho2cad")
ex = ds["train"][0]

ex["image"]              # PIL.Image, 800x800 RGB orthographic three-view drawing
ex["query"]              # the instruction (byte-identical for every record)
ex["annot"]              # the CadQuery program -- the answer / SFT target

m = json.loads(ex["metadata"])
m["deepcad_id"]          # "0000/00009254" -- traceable back to Onshape
m["skeleton_hash"]       # topology fingerprint (numbers replaced by N)
m["dup_count"]           # occurrences in the original split, before deduplication

query deliberately carries no <image> token -- the team schema keeps the instruction clean. Add it back when converting to the LLaVA / LLaMA-Factory conversations format:

def to_conversations(ex):
    return {"conversations": [
        {"from": "human", "value": "<image>
" + ex["query"]},
        {"from": "gpt",   "value": ex["annot"]},
    ]}

ds = ds.map(to_conversations)

Fields

This dataset uses the AI4Manufacturing shared 7-field SFT schema -- the same columns as AI4Manufacturing/gencad_code, cad_recode and w_cad2 -- so these sets can be mixed without remapping columns.

field type meaning
query string the instruction; identical for every record, and byte-identical to the query of AI4Manufacturing/gencad_code
image Image 800x800 RGB PNG, bytes embedded in the parquet
annot string the CadQuery program -- gold answer and SFT target
reasoning string null by design; chain-of-thought is a separate annotation stage
cate string E
task string T-E1 -- image to CadQuery code generation, the same code as gencad_code
metadata string JSON; everything that does not belong in a fixed column

There is no cadquery column: here the program is the answer, and the schema puts answers in annot. (w_cad2 has one because its comprehension track feeds the program in as input.)

Inside metadata

key meaning
deepcad_id upstream DeepCAD id, traceable all the way back to Onshape
id index within the split
split train / test / validation
code_hash md5(code.strip())[:16] -- exact fingerprint of the program
skeleton_hash fingerprint after replacing every number with N; identifies "same topology, different dimensions"
dup_count how many times this program occurred in the original split, before deduplication
hundred_subset test / val only -- marks the 100 examples used in the Ortho2CAD paper
output_var solid -- see the output contract below
eval_note why exact string match is not a valid score
source, upstream, view_set, views, projection, image_px, annotated_dims, dims_from, cad_ops, dedup, leak_filter provenance and rendering constants, recorded per record so each row documents itself

Output contract: the final solid is bound to solid

Every program in annot assigns its final solid to a variable named solid (verified: 5,105/5,105 in test). The upstream CAD-Coder evaluation appends cq.exporters.export(solid, ...) directly to generated code, so a model trained or evaluated without preserving that name produces programs that run but export nothing.

Exact string match is not a valid metric. The same solid admits many different CadQuery programs. Execute the prediction and compare geometry.

How the splits were made

Upstream ships a split by part id (deepcad_id) only. A split by id does not stop leakage: many distinct parts in DeepCAD have identical modelling command sequences (standard parts), and after conversion their CadQuery code is byte-for-byte the same. The ids do not overlap; the answers do. Three further rules are applied here.

Rule 1 - deduplicate within each split, by code_hash

train  147,123 -> 108,343      test  7,353 -> 6,601      val  8,195 -> 7,265

When one program occurs several times within a split, the drawings are pixel-identical (verified by md5 on sampled groups, including the largest: 1,066 records sharing a single image). Fully redundant; removing them loses no information.

Rule 2 - drop test / val records whose code occurs in train

test   6,601 -> 5,105   (1,496 dropped, 22.7%)
val    7,265 -> 5,363   (1,902 dropped, 26.2%)

Without this step a model memorises 22.7% of the test answers verbatim during training and the reported score is fiction.

Rule 3 - test / val collisions resolved in favour of test

val  5,363 -> 5,330   (33 records yielded)

On dup_count

The train split as shipped is deduplicated. But that 26% of duplication reflects the real distribution -- common standard parts genuinely are common on Onshape, and removing them changes the prior. To restore the original distribution, set each sample's sampling weight to metadata.dup_count; the effect is equivalent to training on the original 147,123 records at a fraction of the disk and loading cost. The field is kept so that this decision stays reversible.

Provenance

Onshape          real people modelling; public in the cloud, readable in bulk via FeatureScript
   |
ABC 2019         1,000,000+ models; B-rep only, design history discarded
   |
DeepCAD 2021     178,238 command sequences; * every non-sketch/extrude design dropped, -82%
   |----------------------------------|
   | translate                         | execute
GenCAD 2024                          Ortho2CAD 2026
CAD-Coder 2025   163,671 programs     175,162 orthographic drawings
   |---- paired by deepcad_id --------|
              |
         ortho2cad (this dataset)

Limitations

Sketch + extrude only

DeepCAD kept only Line / Arc / Circle / Extrude (with boolean union / cut) back in 2021, discarding chamfer, fillet, revolve, sweep, loft and shell -- every design using those operations was cut, 82% of the corpus in one step.

A model trained on this data therefore cannot produce chamfers or fillets. That is a ceiling inherited from the data source, not a limitation of the model.

Only three dimensions are annotated

The dimensions on the drawings are computed from the bounding box: width, height and depth, and nothing else. No hole diameters, no slot depths, no chamfer sizes. The Ortho2CAD paper concedes that internal diameters "will have to be deciphered from the ratio" -- they can only be inferred from proportion.

The structural space is narrow

train  108,343 records  ->  only 19,743 distinct structural skeletons
test     5,105 records  ->  only  1,736

(A skeleton is the code with every number replaced by N.) Even after deduplication, a substantial share of test consists of topologies seen in train at different dimensions. A high score on those may only show that the model performs parameter regression, not that it understands structure. For a stricter read, use metadata.skeleton_hash to carve out the subset whose skeleton never appears in train and report on it separately.

Only syntax has been checked

Every program parses as valid Python (ast.parse), but none has been executed to obtain an actual solid. Upstream GenCAD ran an executability screen (discarding 9,564 programs that produced no solid), so the expected pass rate is high, but this dataset carries no measured figure.

Licensing and provenance notice

This dataset is a reorganisation of upstream work. Redistribution terms for Ortho2CAD, GenCAD-Code, DeepCAD and ABC -- and ultimately for the public Onshape designs at the root of the chain -- have not been independently verified, and no upstream release declares a license (CADCODER/GenCAD-Code leaves the field empty). The license field here is therefore deliberately left blank rather than guessed at. Intended for research use; check the upstream terms before relying on it commercially.

Citation

Please cite the original work:

@inproceedings{koch2019abc,
  title={ABC: A Big CAD Model Dataset For Geometric Deep Learning},
  author={Koch, Sebastian and Matveev, Albert and Jiang, Zhongshi and Williams, Francis
          and Artemov, Alexey and Burnaev, Evgeny and Alexa, Marc and Zorin, Denis
          and Panozzo, Daniele},
  booktitle={CVPR}, year={2019}
}
@inproceedings{wu2021deepcad,
  title={DeepCAD: A Deep Generative Network for Computer-Aided Design Models},
  author={Wu, Rundi and Xiao, Chang and Zheng, Changxi},
  booktitle={ICCV}, year={2021}
}
@article{alam2024gencad,
  title={GenCAD: Image-Conditioned Computer-Aided Design Generation with
         Transformer-Based Contrastive Representation and Diffusion Priors},
  author={Alam, Md Ferdous and Ahmed, Faez},
  journal={arXiv:2409.16294}, year={2024}
}
@article{doris2025cadcoder,
  title={CAD-Coder: An Open-Source Vision-Language Model for Computer-Aided
         Design Code Generation},
  author={Doris, Anna C. and others},
  journal={arXiv:2505.14646}, year={2025}
}
@article{joglekar2026ortho2cad,
  title={Ortho2CAD},
  author={Joglekar, Ajay and others},
  journal={arXiv:2607.08891}, year={2026}
}

Reproduction

The build is fully deterministic -- no random numbers, no sampling; a rerun is byte-identical.

01_annotate.py      mark duplicates / leakage (cross-checked against upstream annotations)
02_split.py         apply the three rules
03_verify.py        nine checks on the splits
04_to_parquet.py    pack to parquet with image bytes embedded
05_dataset_card.py  generate this file
06_verify_dist.py   eight checks on the packaged artifact
07_upload.py        upload to HuggingFace
Downloads last month
22

Papers for AI4Manufacturing/ocad