Skip to main content

VTK Local Rendering using WASM

Project description

VTK Local Rendering using VTK/WASM to match server side rendering pipeline on the client side. The current code base is still at its infancy but we aim to make it the default implementation for local rendering using VTK/ParaView with trame.

License

This library is OpenSource and follow the Apache Software License

Installation

pip install trame-vtklocal

# We need a VTK that has its wasm counterpart
# This is the first version available with it
# For ParaView (not yet supported), VTK don't need to be installed
pip install "vtk==9.4.0rc2" --extra-index-url https://wheels.vtk.org

Development

Build and install the Vue components

cd vue-components
npm i
npm run build
cd -

Install the library

pip install -e .

Optionally, you can develop with bleeding edge VTK by following these steps. Make sure you’ve these tools 1. git 2. CMake 3. Ninja 4. Python 5. NodeJS >= 22.0.0: https://nodejs.org/en/download/package-manager 6. Emscripten SDK: See https://emscripten.org/docs/getting_started/downloads.html#download-and-install

# Compile VTK for wasm32 architecture using emscripten. Build artifacts can be found in dev/vtk/build/wasm
./utils/build_vtk.sh -u https://gitlab.kitware.com/vtk/vtk.git -b master -t wasm32 -p RelWithDebInfo

# Compile VTK with python wrappings using system C++ compiler. Build artifacts can be found in dev/vtk/build/py
./utils/build_vtk.sh -u https://gitlab.kitware.com/vtk/vtk.git -b master -t py -p RelWithDebInfo

# Set environment variables
source ./utils/dev_environment.sh -b master -p RelWithDebInfo

Running examples

pip install trame trame-vtklocal trame-vuetify trame-vtk

# We need a VTK that has its wasm counterpart
# This is the first version available with it
# For ParaView (not yet supported), VTK don't need to be installed
pip install "vtk==9.3.20240810.dev0" --extra-index-url https://wheels.vtk.org

# regular trame app
python ./examples/vtk/cone.py

Some example are meant to test and validate WASM rendering. Some will default for remote rendering but if you want to force them to use WASM just run export USE_WASM=1 before executing them.

SharedArrayBuffer

To enable SharedArrayBuffer within trame you can just set the following on the server

server.http_headers.shared_array_buffer = True

This will download the threaded WASM version. Otherwise, the non-threaded version will be used as it does not require SharedArrayBuffer.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trame-vtklocal-0.6.5.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

trame_vtklocal-0.6.5-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file trame-vtklocal-0.6.5.tar.gz.

File metadata

  • Download URL: trame-vtklocal-0.6.5.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.11.2 readme-renderer/44.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.2.3 tqdm/4.67.0 importlib-metadata/8.5.0 keyring/25.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.15

File hashes

Hashes for trame-vtklocal-0.6.5.tar.gz
Algorithm Hash digest
SHA256 33ecadb169929d2782b30d7e14987dd8be7605dec16b28947e30b6493a77aafe
MD5 23b3d754e2743a263ee5959b5dbfcab1
BLAKE2b-256 2e62857be33a4da6ae2c62397c9471bc42f3aeb287b3d0d9dc442a984350480c

See more details on using hashes here.

File details

Details for the file trame_vtklocal-0.6.5-py3-none-any.whl.

File metadata

  • Download URL: trame_vtklocal-0.6.5-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.11.2 readme-renderer/44.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.2.3 tqdm/4.67.0 importlib-metadata/8.5.0 keyring/25.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.15

File hashes

Hashes for trame_vtklocal-0.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b883827e1a76419af035429206c5e273f26a9f921191f4927dbedba513b9acfe
MD5 4e6cdefe0026132033b879a720b309f6
BLAKE2b-256 70182a641dfedfa9b9aa14f39260555791e0025bb8e0ee673895105a8d8e2690

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page