MechAtlas / README.md
XUXU666's picture
Prepare audited MechAtlas benchmark release (#4)
4df4491
|
Raw History Blame Contribute Delete
7.47 kB
metadata
license: cc-by-4.0
pretty_name: MechAtlas
size_categories:
  - 10K<n<100K
tags:
  - benchmark
  - cad
  - 3d
  - mechanical-engineering
  - engineering-drawings
  - drawing-to-cad
extra_gated_heading: Request access to MechAtlas
extra_gated_description: >-
  Please provide your affiliation and research purpose. Access requests are
  reviewed manually.
extra_gated_button_content: Submit request
extra_gated_fields:
  Affiliation: text
  Research purpose: text

MechAtlas

MechAtlas is a benchmark of 49,662 matched mechanical-engineering samples, with four representations for each sample: a PDF drawing, a PNG drawing image, a STEP model, and a CadQuery Python example.

The original engineering drawings and CAD models were manually created by professional CAD engineers, underwent strict technical review, and were used in real-world industrial production.

MechAtlas supports research on engineering drawing understanding, drawing-to-CAD reconstruction, and correspondence between 2D drawings, 3D geometry, and executable CAD code.

Contents

Dataset overview

Representation Directory Extension Files Description
Engineering drawing drawings/ .pdf 49,662 Mechanical drawing documentation
Drawing image drawings_image/ .png 49,662 Image representation of the corresponding drawing
CAD model STEP/ .step 49,662 Corresponding 3D CAD geometry
CadQuery example cq/ .py 49,662 Executable Python code defining the corresponding geometry

Each matched set of four files is one sample. There are 198,648 data files in total, excluding the README.

Data source

The original drawings and CAD models were authored manually by professional CAD engineers. They passed strict technical review before being used in real industrial production, providing engineering documentation and geometry grounded in production practice.

The benchmark brings together these engineering drawings and CAD models with drawing images and CadQuery code examples under shared sample identifiers. The CadQuery files are provided as executable geometry examples; they are not presented as the original engineers' authoring histories.

Structure and sample matching

All four representations are organized into the same five numbered groups, 0000 through 0004:

MechAtlas/
├── drawings/
│   ├── 0000/00000007.pdf
│   ├── 0001/
│   ├── 0002/
│   ├── 0003/
│   └── 0004/
├── drawings_image/
│   └── 0000/00000007.png
├── STEP/
│   └── 0000/00000007.step
└── cq/
    └── 0000/00000007.py

The tree shows one example sample; drawings_image/, STEP/, and cq/ also contain all five groups.

Group Samples Files per representation
0000 9,903 9,903
0001 9,862 9,862
0002 9,905 9,905
0003 9,997 9,997
0004 9,995 9,995
Total 49,662 49,662

The eight-digit filename stem is the sample identifier. Preserve leading zeros and match files by both group and identifier. For example, 00000007 links the four files shown above.

Identifiers are not a continuous numeric range; enumerate the available files in each group and match their filename stems across the four directories. The group directories are storage partitions, not training, validation, or test splits. No predefined evaluation split is supplied.

Supported research uses

  • Understanding engineering drawing views, dimensions, tolerances, and technical annotations.
  • Reconstructing CAD geometry from engineering drawings.
  • Matching and retrieving related 2D drawings and 3D CAD models.
  • Studying the relationship between geometry and executable CadQuery examples.

Experiments should state their sample selection, dataset revision, split definitions, and evaluation metrics.

Access and download

MechAtlas is a gated dataset with manual approval.

  1. Sign in to your Hugging Face account.
  2. Provide your affiliation and research purpose in the access request form.
  3. Submit the request for review.
  4. After approval, download files from Files and versions or use authenticated Hugging Face tooling.

To download only sample 00000007, install the client and sign in with the approved account:

python -m pip install huggingface_hub
hf auth login

Then run this Python example. It uses the saved login; no token needs to be placed in the code.

from huggingface_hub import snapshot_download

snapshot_download(
    repo_id="XUXU666/MechAtlas",
    repo_type="dataset",
    local_dir="MechAtlas",
    allow_patterns=[
        "drawings/0000/00000007.pdf",
        "drawings_image/0000/00000007.png",
        "STEP/0000/00000007.step",
        "cq/0000/00000007.py",
    ],
)

See the official download guide for more options.

Keep the directory structure and filenames when downloading or extracting files so that the four representations remain matched.

Using the files

PDF and PNG drawings

Open PDFs in a PDF viewer and PNGs in an image viewer or image-processing library. The PDF collection contains 49,677 pages across 49,662 files. For the 12 multi-page PDFs, the corresponding PNG contains the pages stacked vertically in source order. A PNG therefore represents a sample, not necessarily a single page.

The PNG collection contains 49,597 files at 600 dpi and 65 large-page files at 150 dpi. Images are lossless RGB, and pixel dimensions vary. Image loaders should support large images and should not assume a fixed canvas size. PDF content can include both vector and raster elements.

STEP models

Open STEP files with CAD software or a geometry library that supports the STEP format. Match the model to its drawing using the shared filename identifier.

CadQuery examples

Each Python example defines result as a cadquery.Workplane. Some results contain a compound rather than a single solid, and larger scripts can require more processing time and memory.

The tested environment uses Python 3.12.14, CadQuery 2.7.0, and cadquery-ocp 7.8.1.1.post1. Geometry-kernel behavior can differ between versions. In a compatible Python environment, install the dependencies with:

python -m pip install "cadquery==2.7.0" "cadquery-ocp==7.8.1.1.post1"

From the dataset root, load a sample and optionally export its result:

import runpy
import cadquery as cq

result = runpy.run_path("cq/0000/00000007.py")["result"]
cq.exporters.export(result, "example_model.step")

The export is optional; opening the supplied Python file does not automatically save a new STEP file.

License

MechAtlas is distributed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).

Use and redistribution must comply with the license terms. The access request process governs downloads from this repository; the license governs use and redistribution of the data.