Rust bindings for lib3mf (dynamic loading).
These bindings are generated by the Automatic Component Toolkit (ACT) from the lib3mf XML interface. Source of the generator:
This work is based on experimental Rust bindings in:
- src/lib.rs: Generated Rust bindings (FFI + loader)
- Cargo.toml: Rust crate manifest
- examples/: Example programs
- libraries/: Prebuilt lib3mf shared libraries for multiple platforms
- Rust (edition 2021)
- A lib3mf shared library (.so/.dylib/.dll)
On Linux/macOS, the loader uses dlopen; on Windows it uses LoadLibrary.
Linux/macOS:
./run_examples.shWith a 3MF file for the mesh reader:
./run_examples.sh path/to/model.3mfWindows PowerShell:
.\run_examples.ps1With a 3MF file:
.\run_examples.ps1 path\to\model.3mfcargo build --offlineexamples/version.rs— prints lib3mf versionexamples/create_cube.rs— writescube.3mfexamples/read_meshes.rs— loads a 3MF and prints mesh stats
read_meshes supports --buffer to use ReadFromBuffer instead of ReadFromFile.
- The API is a thin, generated layer that mirrors the C exports.
- The examples use the raw API handles through
Wrapper::api().