Datasets:

Modalities:
3D
Languages:
English
ArXiv:
License:
The Dataset Viewer has been disabled on this dataset.

KnitCAD

Project Page Paper Weights

KnitCAD is a dataset of assembled pairs of B-rep CAD parts. Each pair comes with labeled contact faces and a text prompt for each part. It was built for compositional CAD generation: given one part and a text prompt, generate a second part that fits it. KnitCAD was introduced in CADKnitter: Compositional CAD Generation from Text and Geometry Guidance (SIGGRAPH Asia 2026).

Assembled pairs 156,654
Distinct B-rep models 172,265
Samples (target, condition, prompt) 313,308: each pair is used twice, with either part as the target
Sources Fusion 360 Gallery Assembly – Joint Data (12,401 pairs), AutoMate (144,253 pairs)
Text prompts Generated with GPT-4.1 from multi-view renders
Archive size ~115 GB (compressed)

Example

The prompts for pair f018083, where each part's prompt describes that part in terms of the other:

object_1: Make a solid round rod with flat ends, so that it can slide smoothly through the round tunnel running from end to end inside the long rectangular block of the given object.

object_2: Make a long, hollow block with a rectangle shape and rounded edges, and put a round tunnel all the way through its short ends, so the solid cylinder you have can slide through the tunnel from one end to the other.

How the data was built

  1. Pairs. Part pairs are taken from Fusion 360 Joint (one representative joint per model pair) and AutoMate (duplicate mates between the same pair of models removed). The joint/mate metadata is used to assemble each pair, so both parts share a single global coordinate frame.
  2. Contact faces. Each face is sampled on a 32×32 grid with OpenCASCADE. A face counts as a contact face when its points are within a small distance tolerance of a face on the other part and the two faces' normals point in opposite directions.
  3. Text prompts. Each part and the assembled pair are rendered from multiple views with OpenCASCADE. An MLLM (GPT-4.1) describes each part, then fuses the two descriptions into one generation instruction per part. A random subset of 1,000 samples was checked by hand before the pipeline was run on the rest of the data.
  4. Geometry encoding. Every part is stored in the BrepGen representation: sampled face and edge geometry, bounding boxes, and topology. The VAE latents and the BERT text embeddings are precomputed so models can train directly from the files.

See Section 3 and the appendix of the paper for details.

Files

knitcad.tar.gz.aa  (32.2 GB) ┐
knitcad.tar.gz.ab  (32.2 GB) │  one tar.gz archive, split into 4 parts
knitcad.tar.gz.ac  (32.2 GB) │
knitcad.tar.gz.ad  (18.1 GB) ┘
knitcad_data_split.json          full train/val/test split
knitcad_data_split_70faces.json  filtered split used to train CADKnitter

Once extracted, the archive holds one flat folder with one pickle per assembled pair:

knitcad/
├── a000000.pkl
├── ...
├── f018083.pkl
└── ...

The ID prefix gives the source: f = Fusion 360 Joint (the number is the joint-pair index), a = AutoMate.

Download

huggingface-cli download Fsoft-AIC/knitcad --repo-type dataset \
    --include "knitcad.tar.gz.*" "knitcad_data_split*.json" --local-dir ./knitcad_download

# Concatenate the parts and extract in one pass (no merged archive on disk)
cat ./knitcad_download/knitcad.tar.gz.a? | tar -xzf - -C ./knitcad_download

The parts must be concatenated in order (aa, ab, ac, ad) before extraction; extracting a single part on its own will fail. After extraction succeeds, you can delete the .tar.gz.* parts.

To use the data with the CADKnitter code, move the extracted knitcad/ folder to data/pkl and the two split files to data/. See the code repository's README for details.

Splits

Splits are made at the pair level, so both samples from a pair always land in the same split. Each split file is a JSON dict mapping train / val / test to lists of pickle filenames (e.g. "f018083.pkl").

Split file train val test total pairs
knitcad_data_split.json 124,987 15,811 15,856 156,654
knitcad_data_split_70faces.json 47,502 6,035 4,722 58,259

knitcad_data_split_70faces.json is a strict subset of the full split, and every pair keeps the same train/val/test assignment. It drops pairs in which a part has more than 70 faces, more than 10 contact faces, more than 40 edges per face, or more than one solid body. CADKnitter is trained on this split (47,502 training pairs × 2 directions = 95,004 training samples). The CADKnitter evaluation scripts build their ground truth from this split's test set.

Data format

Each .pkl is a Python dict:

{
    "object_1": {...},          # part A (fields below)
    "object_2": {...},          # part B (fields below)
    "contact_surfaces": [       # one entry per contact region
        {"surface1_id": [0, 1],   # face indices in object_1
         "surface2_id": [9, 10]}, # matching face indices in object_2
        ...
    ],
}

Per-object fields, with F = number of faces, E = number of edges, V = number of unique vertices, and T = number of text tokens:

Key Shape / type Description
surf_wcs (F, 32, 32, 3) float32 Face points sampled on a 32×32 UV grid, in the shared (world) coordinate frame
surf_ncs (F, 32, 32, 3) float32 The same points, normalized per face to [-1, 1]
edge_wcs (E, 32, 3) float32 32 points sampled along each edge, world frame
edge_ncs (E, 32, 3) float32 The same points, normalized per edge
corner_wcs (E, 2, 3) float32 The two endpoints of each edge
corner_unique (V, 3) float32 Deduplicated vertices
surf_bbox_wcs (F, 6) float32 Face bounding boxes [xmin, ymin, zmin, xmax, ymax, zmax]
edge_bbox_wcs (E, 6) float32 Edge bounding boxes, same layout
edgeFace_adj (E, 2) int64 The two faces adjacent to each edge
edgeCorner_adj (E, 2) int64 Indices into corner_unique for each edge's endpoints
faceEdge_adj list of F int64 arrays Edge indices that bound each face
prompt str Text instruction for generating this part, given the other part
surfz (F, 16, 3) float32 Precomputed surface-VAE latent per face (a 4×4×3 latent, flattened)
edgez (E, 4, 3) float32 Precomputed edge-VAE latent per edge
text_embeds (T, 1024) float32 prompt encoded with frozen bert-large-uncased (last hidden state)
text_mask (T,) bool Key-padding mask for text_embeds: True = padding

To build one generation sample, choose a target object and use the other as the condition: the target's prompt, the condition's geometry, and the condition's side of contact_surfaces.

Loading

import json
import pickle

split = json.load(open("knitcad_data_split_70faces.json"))
uid = split["test"][0]

with open(f"knitcad/{uid}", "rb") as f:
    pair = pickle.load(f)

target, cond = pair["object_1"], pair["object_2"]
print(target["prompt"])
print("condition faces:", cond["surf_bbox_wcs"].shape[0])
print("condition contact faces:",
      sorted({int(i) for c in pair["contact_surfaces"] for i in c["surface2_id"]}))

Only NumPy is needed to unpickle the files. Unpickling runs arbitrary code, so only load pickles from this repository or another source you trust.

License

KnitCAD is released under CC BY-NC 4.0. It is derived from Fusion 360 Gallery Assembly – Joint Data and AutoMate, so the CAD geometry is also subject to the licenses of those datasets. Check their terms before using KnitCAD.

Citation

If you use KnitCAD, please cite CADKnitter as well as the two source datasets, Fusion 360 Gallery Assembly – Joint Data (JoinABLe) and AutoMate:

@inproceedings{le2026cadknitter,
  author    = {Le, Tri and Nguyen, Khang and Huang, Baoru and Ta, Tung D and Nguyen, Anh},
  title     = {CADKnitter: Compositional CAD Generation from Text and Geometry Guidance},
  booktitle = {SIGGRAPH Asia 2026 Conference Papers},
  year      = {2026},
  doi       = {10.1145/3829340.3842261},
}

@article{willis2021joinable,
  title={JoinABLe: Learning Bottom-up Assembly of Parametric CAD Joints},
  author={Willis, Karl DD and Jayaraman, Pradeep Kumar and Chu, Hang and Tian, Yunsheng and Li, Yifei and Grandi, Daniele and Sanghi, Aditya and Tran, Linh and Lambourne, Joseph G and Solar-Lezama, Armando and Matusik, Wojciech},
  journal={arXiv preprint arXiv:2111.12772},
  year={2021}
}

@article{jones2021automate,
  author = {Jones, Benjamin and Hildreth, Dalton and Chen, Duowen and Baran, Ilya and Kim, Vladimir G. and Schulz, Adriana},
  title = {AutoMate: A Dataset and Learning Approach for Automatic Mating of CAD Assemblies},
  journal = {ACM Transactions on Graphics},
  year = {2021},
  volume = {40},
  number = {6},
  articleno = {227},
  numpages = {18},
  doi = {10.1145/3478513.3480562},
}
Downloads last month
117

Papers for Fsoft-AIC/knitcad