pyvista_wasm.PLYReader#

class pyvista_wasm.PLYReader(path: str | Path)#

Bases: object

Reader for PLY (Polygon File Format) files (.ply).

Reads a PLY ASCII file and produces a Mesh that delegates parsing to VTK.wasm’s vtkPLYReader at render time. Python extracts only the vertex coordinates so that camera framing and bounding-sphere queries work before rendering.

Parameters:

path (str or Path) – Path to the .ply file.

Examples

>>> import pyvista_wasm as pv
>>> reader = pv.PLYReader("model.ply")
>>> mesh = reader.read()
__init__(path: str | Path) None#

Initialize the reader with a file path.

Methods

__init__(path)

Initialize the reader with a file path.

read()

Read the PLY file and return a Mesh.

Attributes

path

Return the file path.

property path: Path#

Return the file path.

Returns:

The path to the PLY file.

Return type:

Path

read() _PLYMesh#

Read the PLY file and return a Mesh.

Vertex coordinates and face connectivity are extracted on the Python side so that the mesh can be rendered via the standard geometry pipeline without requiring a VTK.wasm file reader.

Returns:

A mesh with extracted points and face connectivity.

Return type:

Mesh

Raises:

ValueError – If the file format is invalid or unsupported.