pyvista_js.PolyDataReader#
- class pyvista_js.PolyDataReader(path: str | Path)#
ベースクラス:
objectReader for legacy VTK PolyData files (
.vtk).Reads a legacy VTK ASCII file and produces a
Meshthat delegates parsing to vtk.js'svtkPolyDataReaderat render time. Python extracts only the point coordinates so that camera framing and bounding-sphere queries work before rendering.- パラメータ:
path (str or Path) -- Path to the
.vtkfile.
サンプル
>>> import pyvista_js as pv >>> reader = pv.PolyDataReader("sphere.vtk") >>> mesh = reader.read()
- __init__(path: str | Path) None#
Initialize the reader with a file path.
Methods
Attributes
Return the file path.
- property path: Path#
Return the file path.
- 戻り値:
The path to the VTK file.
- 戻り値の型:
Path
- read() _PolyDataMesh#
Read the VTK file and return a Mesh.
The full file content is stored so that vtk.js can parse it at render time. Point coordinates are extracted on the Python side for bounding-sphere and camera-framing calculations.
- 戻り値:
A mesh backed by the VTK file content.
- 戻り値の型:
Mesh
- 例外:
ValueError -- If the file format is invalid or unsupported.