Skip to content
 
 

Repository files navigation

cadmpeg

One open pipeline for native CAD.

cadmpeg is a toolchain for reading, inspecting, converting, and writing native CAD files. The CLI converts and inspects documents. The libraries add vendor-file support to other applications.

Decoders map vendor files into one documented IR: preview meshes, B-rep geometry, design intent, and parametric history where the format carries them. Validators, exporters, and downstream tools share that IR. Progress per format follows an L0–L9 support ladder.

Try it · Format support · Donate a test file · Contribute

Why cadmpeg

Native CAD formats are proprietary and sparsely documented. cadmpeg recovers geometry and design data into one IR. Values retain source byte offsets. Inferred values are marked. Unsupported content is reported as loss.

Format knowledge comes from legally possessed CAD files and public documentation. Vendor SDKs, decompiled binaries, and confidential material are prohibited (LEGAL.md).

Install

Build from source with Rust 1.88 or later:

git clone https://github.com/cadmpeg/cadmpeg
cd cadmpeg
cargo install --path crates/cadmpeg

Homebrew (macOS):

brew install cadmpeg/tap/cadmpeg

Installer script (macOS, Linux):

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/cadmpeg/cadmpeg/releases/latest/download/cadmpeg-installer.sh | sh

Windows:

powershell -ExecutionPolicy Bypass -c "irm https://github.com/cadmpeg/cadmpeg/releases/latest/download/cadmpeg-installer.ps1 | iex"

Quick start

cadmpeg convert part.f3d -f step

Conversion reports validation results and loss:

decode report (f3d): geometry_transferred=true
losses:
  [info/geometry] 22 spline surface record(s) were decoded into NURBS carriers.
  ...
validation: OK (0 error(s), 0 warning(s))
wrote part.step (2125 entities)

Format support

  • FreeCAD .FCStdL5 (schema 4 / file 1)
  • Autodesk Fusion .f3dL4
  • SolidWorks .sldprtL4
  • Rhino .3dmL8 (archive 50/60/70/80); older bands L1 / L0
  • Siemens NX .prtL3 (selected or terminal-lineage-resolved body images); L2 (unresolved multi-partition history)
  • CATIA V5 .CATPartL2 (standard-nested); L1 (other layouts)
  • Creo .prtL1
  • STEP Part 21 AP203/AP214/AP242L9
  • IGES 5.3 Fixed ASCIIL8
  • ASM .sat/.smt/.smb/.sab streams — bare ShapeManager B-rep streams, binary and text encodings

Format support holds profiles and scoring rules. docs/formats/ holds byte semantics and open items.

Pipeline

input file ──▶ container decoder ──▶ format decoder ──▶ IR ──▶ validator ──▶ exporter ──▶ output + reports

Decoders produce the IR. Validators check it. Exporters consume it.

CLI

cadmpeg inspect  part.f3d
cadmpeg decode   part.f3d -o part.cadir.json
cadmpeg validate part.cadir.json
cadmpeg export   part.cadir.json -f step -o part.step
cadmpeg convert  part.f3d -f step -o part.step
cadmpeg diff     a.cadir.json b.cadir.json

Output formats are cadir, step, fcstd, f3d, sldprt, and rhino; json aliases cadir. export and convert infer omitted formats from the output extension. Use --input-format to override source detection. Use --step-target and --reject-step-losses for STEP schema selection and strict loss refusal.

Machine-readable output from inspect --json, validate --json, and diff --json, plus command report files, uses CLI schema_version: 5. That envelope version is independent of CAD IR ir_version: "5".

Contributing

Public test files are the most immediate need. If you can dedicate a CAD file to the public domain under CC0, please donate it to the corpus.

Other contributions:

  • Implement a codec from a format specification.
  • Resolve an open format item with byte-backed evidence.
  • Add validators, exporters, IR tooling, corpus tooling, or CLI improvements.

Commits require DCO sign-off; decoder and specification changes also require a provenance declaration. See CONTRIBUTING.md, LEGAL.md, and the roadmap.

Development

From the repository root:

cargo build --workspace
cargo test-fast

Run an end-to-end smoke test:

cargo run -p cadmpeg-ir --example emit_cube > cube.cadir.json
cadmpeg export cube.cadir.json -f step -o cube.step

AI-assisted contributions are welcome when reviewed and concise. Clean-room rules still apply: do not pass vendor SDK knowledge through a model.

Licensing

Code uses the Apache License 2.0; documentation and specifications use CC BY 4.0. Contributions use the corresponding license.

SolidWorks, Rhino, CATIA, Autodesk Fusion, Creo, NX, Parasolid, and other product names are trademarks of their respective owners. cadmpeg uses them only to identify the file formats its decoders target. cadmpeg is an independent project and is not affiliated with, endorsed by, or sponsored by any CAD vendor. See LEGAL.md.

About

Convert all CAD formats

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages