Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
cadrum
Rust CAD library powered by OpenCASCADE (OCCT 7.9.3).
Usage
More examples with source code are available at lzpel.github.io/cadrum.
Add this to your Cargo.toml:
[]
= "^0.4"
Primitives: box, cylinder, sphere, cone, torus — colored and exported as STEP + SVG. (examples/01_primitives.rs)
use ;
use DVec3;
Full: Make drum with colors, boolean ops, and SVG export, which is shown at the top of this page. (examples/05_chijin.rs)
Provides safe, ergonomic wrappers around the OCC C++ kernel for:
- Reading/writing STEP and BRep formats (stream-based, no temp files)
- Constructing primitive shapes (box, cylinder, sphere, cone, torus)
- Boolean operations (union, subtract, intersect)
- Face/edge topology traversal
- Meshing with customizable tolerance
- SVG export with hidden-line removal and face colors (
colorfeature)
Requirements
- A C++17 compiler (GCC, Clang, or MSVC)
- CMake
Tested with GCC 15.2.0 (MinGW-w64) and CMake 3.31.11 on Windows.
Build
By default, cargo build downloads OCCT 7.9.3 source and builds it automatically.
The built library is placed in target/occt/ and removed by cargo clean.
To cache the OCCT build across cargo clean, set OCCT_ROOT to a persistent directory:
- If
OCCT_ROOTis set and the directory already contains OCCT libraries, they are linked directly (no rebuild). - If
OCCT_ROOTis set but the directory is empty or missing, OCCT is built and installed there. - To force a rebuild, remove the directory:
rm -rf ~/occt
Features
color(default): Colored STEP I/O via XDE (STEPCAFControl). Enableswrite_step_with_colors,read_step_with_colors, and per-face color onSolid. Colors are preserved through boolean operations and other transformations.
License
This project is licensed under the MIT License.
Compiled binaries include OpenCASCADE Technology (OCCT), which is licensed under the LGPL 2.1. Users who distribute applications built with cadrum must comply with the LGPL 2.1 terms. Since cadrum builds OCCT from source, end users can rebuild and relink OCCT to satisfy this requirement.