Rust bindings for the Visualization Toolkit (VTK).
The goal of this project is to provide safe and thin bindings. This means we are planning to support as much of the original functionality as possible, provided that their use is reasonable from a rusty point of view. This crate does in particular not aim at formulating higher-level interfaces such as pyvista although such functionality could be added in the future within the scope of additional crates.
This crate will be reworked using vtkWrap in order to automate much of the process of generating the bindings. In its current state, the crate will probably remain unusable for the coming weeks.
stable | Env Flags + Command | |
---|---|---|
ubuntu-24.04 |
cargo test |
|
ubuntu-22.04 |
cargo test |
|
macos-13 |
cargo test |
|
macos-14 |
cargo test |
|
macos-15 |
cargo test |
This package relies on a system install of vtk
.
We currently only test versions >=9.1
.
In some scenarios, it might be necessary to install additional dependencies.
Otherwise, compilation of the cmake
part might fail with spurious linker errors.
Distro | Packages |
---|---|
Archlinux | pacman -S clang cmake vtk openmpi fast_float nlohmann-json gl2ps utf8cpp |
Ubuntu 22 & 24 | apt install libvtk9.1 libvtk9-dev |
Macos 13 & 14 | brew install vtk |
vtk-rs
will try to determine the path for vtk
automatically.
It is possible to control the compilation process via environment flags.
Flag | Effect |
---|---|
VTK_DIR |
cargo:rustc-link-search=$VTK_DIR |
VTK_VERSION |
Add suffix to vtk libraries (i.e. libvtkCommonCore-9.4 ). |
This crate builds on cmake
and cxx
in order to generate the necessary code and bindings.
The bindings for vtk
modules are written manually in C++
.
From there, we generate appropriate bindings with cxx::bridge
using the CLI tool
cxxbridge
.
However, we do not use cxx
to compile the code but rather let cmake
handle this task.
To implement the desired class methods, we use Rust
macros.
- Stabilize Build system
- Automate system library detection and generate linker flags
- Gradually implement functionality for examples. Start with 3D geometry.