Dataset Viewer

The dataset viewer should be available soon. Please retry later.

CadQuarry

Procedurally generated, execution-validated, fully parametric CadQuery programs and the geometry they produce. Every part is a pure Python function of typed, range-bounded parameters and is reproducible bit-for-bit from a seed.

Each corpus in this dataset is a convenience artifact: the generator plus the seed ladder is the actual deliverable. Any corpus can be regenerated locally.


Quick start

Python (datasets library)

pip install datasets
from datasets import load_dataset

# Code + metadata only (fastest):
ds = load_dataset("jacobjennings/cadquarry", "1k", split="train")
print(ds[0]["source"])   # full parametric CadQuery program
print(ds[0]["family"])   # e.g. "plate", "revolved", "block"

# With 8-view renders (PIL Images):
ds = load_dataset("jacobjennings/cadquarry", "1k-renders", split="train")
ds[0]["render_iso"].show()         # isometric view
ds[0]["render_front"].show()       # front orthographic

# With STL mesh:
import trimesh, io
ds = load_dataset("jacobjennings/cadquarry", "1k-stl", split="train")
mesh = trimesh.load(io.BytesIO(ds[0]["stl_bytes"]), file_type="stl")
mesh.show()

# Full corpus (renders + STL + STEP):
ds = load_dataset("jacobjennings/cadquarry", "1k-full", split="train")
with open("part.step", "wb") as f:
    f.write(ds[0]["step_bytes"])

HuggingFace CLI

pip install huggingface_hub

# Code-only corpus:
huggingface-cli download jacobjennings/cadquarry \
    --repo-type dataset \
    --include "1k/corpus.jsonl" \
    --local-dir ./cadquarry-1k

# All variants for one size:
huggingface-cli download jacobjennings/cadquarry \
    --repo-type dataset \
    --include "1k/*" \
    --local-dir ./cadquarry-1k

Python Hub API (selective download)

from huggingface_hub import snapshot_download

local = snapshot_download(
    "jacobjennings/cadquarry",
    repo_type="dataset",
    allow_patterns=["1k/corpus.jsonl", "1k/corpus-stl.parquet"],
)

Content variants

Each corpus size ships as six HuggingFace configs so you only fetch what you need:

Config suffix Content File format
(none) CadQuery source + metadata JSONL
-renders + 8 shaded render images Parquet (render_* = image)
-stl + binary STL mesh Parquet (stl_bytes = binary)
-step + binary STEP B-rep Parquet (step_bytes = binary)
-geo + renders + STL Parquet
-full + renders + STL + STEP Parquet

Complexity-tier slices

Every content variant above is published along a second axis so you can exclude the highest-complexity parts without filtering yourself:

Tier slice Config form Tiers included
All tiers {tag}{suffix} (e.g. 1k, 1k-renders) 0–3
Tiers 0–2 {tag}-t0-2{suffix} (e.g. 1k-t0-2, 1k-t0-2-renders) 0, 1, 2
# All tiers (default naming):
ds = load_dataset("jacobjennings/cadquarry", "1k", split="train")

# Tiers 0–2 only:
ds = load_dataset("jacobjennings/cadquarry", "1k-t0-2", split="train")

The two slices share the same schema; the -t0-2 slice simply omits every row with tier == 3. Data files live under {tag}/ (all tiers) and {tag}/tier0-2/ (tiers 0–2).


Corpus sizes

Tag Parts Seed Available configs
1k 1,000 1234 1k, 1k-renders, 1k-stl, 1k-step, 1k-geo, 1k-full, 1k-t0-2, 1k-t0-2-renders, 1k-t0-2-stl, 1k-t0-2-step, 1k-t0-2-geo, 1k-t0-2-full
2k 2,000 2468 2k, 2k-renders, 2k-stl, 2k-step, 2k-geo, 2k-full, 2k-t0-2, 2k-t0-2-renders, 2k-t0-2-stl, 2k-t0-2-step, 2k-t0-2-geo, 2k-t0-2-full
5k 5,000 50500 5k, 5k-renders, 5k-stl, 5k-step, 5k-geo, 5k-full, 5k-t0-2, 5k-t0-2-renders, 5k-t0-2-stl, 5k-t0-2-step, 5k-t0-2-geo, 5k-t0-2-full
10k 10,000 20260605 10k, 10k-renders, 10k-stl, 10k-step, 10k-geo, 10k-full, 10k-t0-2, 10k-t0-2-renders, 10k-t0-2-stl, 10k-t0-2-step, 10k-t0-2-geo, 10k-t0-2-full
20k 20,000 200200 20k, 20k-renders, 20k-stl, 20k-step, 20k-geo, 20k-full, 20k-t0-2, 20k-t0-2-renders, 20k-t0-2-stl, 20k-t0-2-step, 20k-t0-2-geo, 20k-t0-2-full
50k 50,000 770077 50k, 50k-renders, 50k-stl, 50k-step, 50k-geo, 50k-full, 50k-t0-2, 50k-t0-2-renders, 50k-t0-2-stl, 50k-t0-2-step, 50k-t0-2-geo, 50k-t0-2-full
100k 100,000 100100 100k, 100k-renders, 100k-stl, 100k-step, 100k-geo, 100k-full, 100k-t0-2, 100k-t0-2-renders, 100k-t0-2-stl, 100k-t0-2-step, 100k-t0-2-geo, 100k-t0-2-full
200k 200,000 220220 200k, 200k-renders, 200k-stl, 200k-step, 200k-geo, 200k-full, 200k-t0-2, 200k-t0-2-renders, 200k-t0-2-stl, 200k-t0-2-step, 200k-t0-2-geo, 200k-t0-2-full

Schema

All configs include:

Column Type Description
part_id string Unique deterministic identifier
family string plate, bracket, revolved, block, compound, enclosure, flanged, ribbed, profiled, gear, threaded
tier int32 Complexity tier 0–3
seed int64 Per-part seed
symmetry string Detected symmetry class
op_count int32 Number of CadQuery operations
ir_hash string SHA-256 of the canonical IR (dedup key)
generator_version string CadQuarry version
license string Always CC0-1.0
geometry_signature string (JSON) Volume, surface area, face/edge/vertex counts
dimensions string Procedural human-readable dimension summary (prompt-friendly)
source string Full .py CadQuery program
params string (JSON) Typed parameter schema with ranges and defaults

Geometry columns (geometry variants only):

Column Type Present in
render_frontrender_iso_bl image -renders, -geo, -full
stl_bytes binary -stl, -geo, -full
step_bytes binary -step, -full

Render views: front, top, right, iso, iso_fr, iso_fl, iso_br, iso_bl.


Reproducibility

Same generator version + seed ⇒ identical corpus bit-for-bit:

pip install -e ".[dev]"   # from the generator repo
cadquarry generate \
    --seed <seed> --count <count> \
    --config configs/default.toml \
    --out <output_dir>

To regenerate with all geometry:

cadquarry build --sizes <tag> --formats step,stl,render --out datasets/

Working with the parametric source

Each source is a standalone Python module with two exports:

PARAMS: dict[str, dict]          # typed parameter schema
def build(p: dict) -> cq.Workplane: ...

Run a part with CadQuery installed:

import cadquery as cq, json

source = ds[0]["source"]
params = json.loads(ds[0]["params"])
defaults = {k: v["default"] for k, v in params.items()}

ns = {}
exec(compile(source, "<part>", "exec"), ns)
result = ns["build"](defaults)
cq.exporters.export(result, "part.step")
Downloads last month
330