vtk-rs 0.1.2

Rust bindings for the Visualization Toolkit (VTK)
Documentation

Crates.io Version Crates.io License Docs

vtk-rs

Rust bindings for the Visualization Toolkit (VTK).

Testing

stable beta nightly Build
ubuntu-24.04 stable-ubuntu-24_04 beta-ubuntu-24_04 nightly-ubuntu-24_04 cargo build --features vtk9-1
ubuntu-22.04 stable-ubuntu-22_04 beta-ubuntu-22_04 nightly-ubuntu-22_04 cargo build --features vtk9-1
macos-13 stable-macos-13 beta-macos-13 nightly-macos-13 cargo build --features vtk9-4
macos-14 stable-macos-14 beta-macos-14 nightly-macos-14 cargo build --features vtk9-4

Dependencies

This package relies on a system install of vtk. In some scenarios, it might be necessary to install additional dependencies. Otherwise, compilation of the cmake part might fail linker errors.

Distro Packages
Archlinux pacman -S clang cmake vtk openmpi fast_float nlohmann-json gl2ps utf8cpp
Ubuntu 22 & 24 sudo apt install libvtk9.1 libvtk9-dev

Building

vtk-rs will try to determine the path for vtk automatically. It is also possible to specify said path directly with the VTK_DIR environment variable.

Internals

This crate builds on cmake and cxx in order to generate the necessary code and bindings. We manually write code for individual modules of vtk from which we generate appropriate bindings with cxx::bridge using the provided CLI tool cxxbridge. However, we do not use cxx to compile the code but rather let cmake handle this task.

Roadmap

  1. Stabilize Build system
  2. Automate system library detection and generate linker flags
  3. Gradually implement functionality for examples. Start with 3D geometry.