read_legacy

read_legacy(filename)

Use VTK’s legacy reader to read a file.

This uses vtk.vtkDataSetReader to read the data.

Parameters
filenamestr

The string path to the file to read.

Returns
pyvista.DataSet

Wrapped pyvista mesh.

Notes

Normally, you should use pyvista.read() to read in meshes from file, and this reader will automatically used for '.vtk' and '.pvtk' files.

Examples

Load an example mesh using the legacy reader.

>>> import pyvista
>>> from pyvista import examples
>>> mesh = pyvista.read_legacy(examples.uniformfile)