Skip to main content

General-purpose features that may be integrated into VTK library in the future.

Project description

vtk-u3dexporter

Build Wheels PyPI Version License

vtk-u3dexporter is a VTK module for exporting a VTK 3D scene to the U3D file format, which can be embedded into PDF files.

It is available as both C++ class and a Python package.

Installation

You can install vtk-u3dexporter via pip:

pip install vtk-u3dexporter

Usage

Here is a brief example of how to use vtk-u3dexporter to export a simple cube scene:

import os
import vtk
from vtk import vtkU3DExporter

# Define the cube source
cube = vtk.vtkCubeSource()

# Define the cube mapper
cubeMapper = vtk.vtkPolyDataMapper()
cubeMapper.SetInputConnection(cube.GetOutputPort())

# Define the cube actor
cubeActor = vtk.vtkActor()
cubeActor.SetMapper(cubeMapper)

# Define the render window and renderer
renderWindow = vtk.vtkRenderWindow()
renderWindow.OffScreenRenderingOn()
renderer = vtk.vtkRenderer()
renderWindow.AddRenderer(renderer)

# Add the cube to the renderer
renderer.AddActor(cubeActor)

# Automatically reset the camera
renderer.ResetCamera()

# Define the output file name, which will have the ".u3d" extension appended automatically
filePath = "cube"

# Export to U3D
u3dExporter = vtkU3DExporter.vtkU3DExporter()
u3dExporter.SetFileName(filePath)
u3dExporter.SetInput(renderWindow)
u3dExporter.Write()

# Check that the file exists
assert os.path.exists(f"{filePath}.u3d")

In this example, we create a simple cube scene using VTK, add it to a renderer, and then export it to U3D format using vtk-u3dexporter. We then verify that the output file exists.

License

vtk-u3dexporter is distributed under the Apache License 2.0. Please see the LICENSE file for details.

Resources

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

vtk_u3dexporter-0.3.0-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11 Windows x86-64

vtk_u3dexporter-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

vtk_u3dexporter-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

vtk_u3dexporter-0.3.0-cp311-cp311-macosx_10_10_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11 macOS 10.10+ x86-64

vtk_u3dexporter-0.3.0-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10 Windows x86-64

vtk_u3dexporter-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

vtk_u3dexporter-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

vtk_u3dexporter-0.3.0-cp310-cp310-macosx_10_10_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10 macOS 10.10+ x86-64

vtk_u3dexporter-0.3.0-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9 Windows x86-64

vtk_u3dexporter-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

vtk_u3dexporter-0.3.0-cp39-cp39-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

vtk_u3dexporter-0.3.0-cp39-cp39-macosx_10_10_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9 macOS 10.10+ x86-64

vtk_u3dexporter-0.3.0-cp38-cp38-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8 Windows x86-64

vtk_u3dexporter-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

vtk_u3dexporter-0.3.0-cp38-cp38-macosx_10_10_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8 macOS 10.10+ x86-64

File details

Details for the file vtk_u3dexporter-0.3.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7bda25a6b44cf1a41952aa2f051d4ff69e39ab799833c5f597abf8daea0b870a
MD5 353ce0f9af8551238fd63be2f8e5105f
BLAKE2b-256 c21caabb4b5468b4ac0eb04afcd4c3586e0bc50c06065610c9bb298814ac134e

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c595cb5ea4757dd4e5991555b48c04a116810281929e9dddd3dd0dc505b4b2bf
MD5 70b03431982cb055f0127e2ae96a03ad
BLAKE2b-256 e224d54c9f4fd0f1bf787caa6e8e0b326e7420c649227b17c7321c51125660b6

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d9f1ba2b38402bd3ec83f8f11a2a643b7028e159bcdb8eaf347e231318a0a650
MD5 694f73ccf2960c08070203dda0d6d563
BLAKE2b-256 9636f20cfb5054dccbb4d1536cc9b1dc92bdc482e5aa128303757457c7fd51c6

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp311-cp311-macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp311-cp311-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 65e11a51cb06808645f0da75819db67d698ecd76e7d059258d352f5b4d044c82
MD5 f44f1f56fa31a3adf921f946ea74e20a
BLAKE2b-256 e9ee47aa5f29c62288af9e0404c686d0150ed98fe12484fb2237f785d3ac4a96

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f93260de115c5b19d0cebe957ebe6d194c06c5a1031fc7bca5e34cff66c019f4
MD5 933e65c182df3baf64606a83e305369a
BLAKE2b-256 b81f3387fd1e726355187752943f0e733c6cb4dc2522c0828ea890a0da1957cc

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e9fdd0b5abe0ef4447179fbca053f521b0622443690be53d045462794a69c36a
MD5 da3e2b4b7aa7c64bd084022d60b747eb
BLAKE2b-256 1b31f7fc1b567d3191ecdad1d50782cc05e143db51543c5081c3013336b8be17

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7033ecdb2af77da37087ae6288532cd1e274500f210ece148454707d064c838b
MD5 3a3820a493ea167f2d903bd7dc3d34a2
BLAKE2b-256 02e0ace7276084f63be4e97113c6d5a1279efe765c5d5ccfe3d6ac92d94c54bc

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp310-cp310-macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp310-cp310-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 8ed6a726f5db0f9e257a447dd903f25077fbc4aaca2cb4e0a915fc80cb88efb1
MD5 6879c8473b88a2082f1968b96d7d759d
BLAKE2b-256 0d9420ab353c18e175167beedeb68409ae419976eef0792753eab21d1aeac74c

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ee2b2cd2f4f1c6d17948ae14890e8ecb7647d1d92ed4b91e248c9642ae2def17
MD5 71a2c9afb6950c63cacd25ac74def5c2
BLAKE2b-256 e26b79efbd7f64c9887cc73b1099f5f7313aa83ba81c2e30708da7158677ae85

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5ae0d01d6fb3b9d490453f60488d0f41fc07281f355743a184e904e0258fc07
MD5 69f5812597c83c5bc337fec76479536e
BLAKE2b-256 3a6003cb3607d73219b4cb99a525823c51cf132fba966efb11bca982d83c6f98

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 97524ae0be4898471db9298640b2b51216c73fd42e32ed6bb93d65aa8502d74d
MD5 5ed8fc3b25209de8b6f0747be5181809
BLAKE2b-256 64f3530190382dddc06d7c5fa360294927f93b1c23f65138cd64c277accf0c68

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp39-cp39-macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp39-cp39-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 23b3d0d601b56d65bc8921ba9441f86d98c8ce4c62968184bc04310599dfa683
MD5 99bab93a4907467e55f2dd6de85db13e
BLAKE2b-256 3281d644372646021db999f36839016c63ee7d9356ee5d20d9279f871ecfcc6a

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b2210e93e8ff71b84ec57e074f00abd7ce8baee60f0e0c54a931becc94905408
MD5 d447cf8e4833b55e98ff5349dd22fb92
BLAKE2b-256 e115e8a606ec2519ed77cf9288523384eb4eb3f6196c06d2d829288be22cbda1

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4059913364a07f5c3bbdea3e060a97b082ac8b86f383fcc75fb3925683f0dada
MD5 0d1f23bc2a93b9ae4011fdec590ee987
BLAKE2b-256 fdaf8c5fa1be388fe8f7b1e36553bf18dca2d77aefbcd270149a35f54ab89e31

See more details on using hashes here.

File details

Details for the file vtk_u3dexporter-0.3.0-cp38-cp38-macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for vtk_u3dexporter-0.3.0-cp38-cp38-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 6912ae81df73afcbf0ab62ecaf709ce457b00e442c055b5ea7745d34e9797c7f
MD5 5bb7e4835a4cd7ef46229c4b45fdbe73
BLAKE2b-256 cb31292015719b1fe6dd33360d72a5ca64424c2e316a7a12a2a9c6c319a30eee

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