Drawings CADCraft writes go in cadcraft/ (tools/generate.sh, from cadcraft-cli at storytold/cadcraft b639b18f); contributor-owned drawings go in contributed/<name>/ with a LICENSES.tsv row. tools/check.sh checks every drawing has a licence row and a SHA256SUMS line.
CADCraft Corpus
Real-file test drawings for CADCraft: DXF and DWG files that CADCraft opens, saves in both formats, reopens and compares, reporting what each round trip lost, added or changed.
The files live here, outside the CADCraft repository, so its history stays small and no binary
fixture is ever committed there. Apps don't track this repository's main: they use a pinned
commit, and every file is listed in SHA256SUMS.
Contents: Using it · Layout · What may be added · Adding files · Size guidance · Licence
Using it from CADCraft
Clone this repository next to your CADCraft checkout (../cadcraft-corpus), then from CADCraft:
cargo xtask corpus # every DXF and DWG here, report in ../cadcraft-corpus/report
cargo xtask corpus DIR --out OUT # another folder, report elsewhere
cadcraft-cli roundtrip ../cadcraft-corpus
CADCRAFT_CORPUS_DIR=../cadcraft-corpus cargo test -p cadcraft-io corpus_round_trip_report
CADCRAFT_CORPUS_DIRpoints the harness at any folder.CADCRAFT_CORPUS_STRICT=1fails when a file doesn't open, save or reopen, or when the walk couldn't read a folder.- The report (
report.md,report.json) goes inreport/by default, which is gitignored here. Never commit reports or the saved copies.
Layout
| Folder | What | Made by |
|---|---|---|
cadcraft/ |
Drawings CADCraft itself writes, regenerated by tools/generate.sh |
CADCraft (cadcraft-cli sample) |
contributed/<contributor>/ |
Drawings contributors made and own, each with a row in LICENSES.tsv |
The contributor, in any CAD application |
tools/ |
Generators and checks |
LICENSES.tsv has one row per file: path, author, the application and version that wrote it,
licence and a short description. tools/check.sh fails when a file has no row or isn't in
SHA256SUMS.
What may be added
- Only drawings the contributor made and owns, under an open licence (CC0-1.0, CC-BY-4.0,
MIT or Apache-2.0), with a row in
LICENSES.tsv. A drawing saved from AutoCAD or another CAD application is fine when the contributor drew it themselves. - Nothing from anyone else. No Autodesk sample drawings, templates (
.dwt), SHX fonts, hatch patterns, linetypes or blocks from a product's library, no drawings downloaded from the web, and no client or employer work, even with permission. - No personal details. Check the file before adding it: no names, user paths, company names
or addresses in title blocks, attributes, xref paths, layer names,
$LASTSAVEDBYor other header variables. Purge what isn't needed. - One feature or one real-world shape per file, named for it
(
contributed/<you>/hatch-island-detection-r2018.dwg), and say which version saved it.
Adding files
- Put the drawing in
contributed/<your GitHub name>/. - Add its row to
LICENSES.tsv. - Update
SHA256SUMS:tools/sums.sh. - Run
tools/check.sh, and the harness from CADCraft (cargo xtask corpus) to see that it opens. - Open a pull request. Say what the drawing exercises and what the report shows for it.
For cadcraft/, run tools/generate.sh with CADCRAFT_CLI pointing at a cadcraft-cli build,
then tools/sums.sh, and give the CADCraft commit in the commit message.
Size guidance
Keep each file under about 5 MB and the whole set under about 200 MB. Large real-world files are welcome when they test something smaller files can't (performance, limits); add them in their own pull request and say why.
Licence
The repository's own files (README, tools, cadcraft/ drawings) are under the MIT License or the
Apache License, Version 2.0, at your option (LICENSE-MIT, LICENSE-APACHE). Each contributed
drawing is under the licence given in its LICENSES.tsv row. See NOTICE.
AutoCAD and DWG are trademarks or registered trademarks of Autodesk, Inc. This project is not affiliated with, sponsored by or endorsed by Autodesk, Inc.