Skip to content

3MFConsortium/lib3mf_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lib3mf_rs

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:

Layout

  • src/lib.rs: Generated Rust bindings (FFI + loader)
  • Cargo.toml: Rust crate manifest
  • examples/: Example programs
  • libraries/: Prebuilt lib3mf shared libraries for multiple platforms

Requirements

  • Rust (edition 2021)
  • A lib3mf shared library (.so/.dylib/.dll)

On Linux/macOS, the loader uses dlopen; on Windows it uses LoadLibrary.

Quick run (build + examples)

Linux/macOS:

./run_examples.sh

With a 3MF file for the mesh reader:

./run_examples.sh path/to/model.3mf

Windows PowerShell:

.\run_examples.ps1

With a 3MF file:

.\run_examples.ps1 path\to\model.3mf

Manual build

cargo build --offline

Examples

  • examples/version.rs — prints lib3mf version
  • examples/create_cube.rs — writes cube.3mf
  • examples/read_meshes.rs — loads a 3MF and prints mesh stats

read_meshes supports --buffer to use ReadFromBuffer instead of ReadFromFile.

Notes

  • The API is a thin, generated layer that mirrors the C exports.
  • The examples use the raw API handles through Wrapper::api().

About

A repository to hold lib3mf Rust bindings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages