pyvista_wasm.PolyDataReader#
- class pyvista_wasm.PolyDataReader(path: str | Path)#
Bases:
objectReader for legacy VTK PolyData files (
.vtk).Reads a legacy VTK ASCII file and produces a
Meshthat delegates parsing to VTK.wasm’svtkPolyDataReaderat render time. Python extracts only the point coordinates so that camera framing and bounding-sphere queries work before rendering.- Parameters:
path (str or Path) – Path to the
.vtkfile.
Examples
>>> import pyvista_wasm 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.
- Returns:
The path to the VTK file.
- Return type:
Path
- read() _PolyDataMesh#
Read the VTK file and return a Mesh.
The full file content is stored so that VTK.wasm can parse it at render time. Point coordinates are extracted on the Python side for bounding-sphere and camera-framing calculations.
- Returns:
A mesh backed by the VTK file content.
- Return type:
Mesh
- Raises:
ValueError – If the file format is invalid or unsupported.