跳转到主要内容

可能未来集成到VTK库中的通用功能。

项目描述

vtk-u3dexporter

Build Wheels PyPI Version License

vtk-u3dexporter是一个VTK模块,用于将VTK 3D场景导出为U3D文件格式,该格式可以嵌入到PDF文件中。

它既可用作C++类,也可用作Python包。

安装

您可以通过pip安装vtk-u3dexporter

pip install vtk-u3dexporter

用法

以下是一个使用vtk-u3dexporter导出简单立方体场景的简要示例

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")

在这个例子中,我们使用VTK创建了一个简单的立方体场景,将其添加到渲染器中,然后使用vtk-u3dexporter将其导出为U3D格式。然后我们验证输出文件是否存在。

许可证

vtk-u3dexporter在Apache License 2.0下分发。有关详细信息,请参阅LICENSE文件。

资源

项目详情


下载文件

下载适合您平台文件的文件。如果您不确定要选择哪一个,请了解更多关于安装包的信息。

源分发

本发布没有可用的源分发文件。请参阅生成分发存档的教程。

构建分发

vtk_u3dexporter-0.3.0-cp311-cp311-win_amd64.whl (1.1 MB 查看哈希值)

上传时间 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 查看哈希值)

上传时间 CPython 3.11 manylinux: glibc 2.17+ x86-64

vtk_u3dexporter-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB 查看哈希值)

上传时间 CPython 3.11 macOS 11.0+ ARM64

vtk_u3dexporter-0.3.0-cp311-cp311-macosx_10_10_x86_64.whl (1.5 MB 查看哈希值)

上传时间 CPython 3.11 macOS 10.10+ x86-64

vtk_u3dexporter-0.3.0-cp310-cp310-win_amd64.whl (1.1 MB 查看哈希值)

上传时间 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 查看哈希值)

上传时间 CPython 3.10 manylinux: glibc 2.17+ x86-64

vtk_u3dexporter-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (1.3 MB 查看哈希值)

上传时间 CPython 3.10 macOS 11.0+ ARM64

vtk_u3dexporter-0.3.0-cp310-cp310-macosx_10_10_x86_64.whl (1.5 MB 查看哈希值)

上传时间 CPython 3.10 macOS 10.10+ x86-64

vtk_u3dexporter-0.3.0-cp39-cp39-win_amd64.whl (1.1 MB 查看哈希值)

上传时间 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 查看哈希值)

上传时间 CPython 3.9 manylinux: glibc 2.17+ x86-64

vtk_u3dexporter-0.3.0-cp39-cp39-macosx_11_0_arm64.whl (1.3 MB 查看哈希值)

上传时间 CPython 3.9 macOS 11.0+ ARM64

vtk_u3dexporter-0.3.0-cp39-cp39-macosx_10_10_x86_64.whl (1.5 MB 查看哈希值)

上传时间 CPython 3.9 macOS 10.10+ x86-64

vtk_u3dexporter-0.3.0-cp38-cp38-win_amd64.whl (1.1 MB 查看哈希值)

上传时间 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 查看哈希值)

上传时间 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 查看哈希值)

上传时间 CPython 3.8 macOS 10.10+ x86-64

由以下赞助

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面