get_reader#
- get_reader(filename)[source]#
Get a reader for fine-grained control of reading data files.
Supported file types and Readers:
File Extension
Class
.cgns
.case
.facet
.foam
.g
.obj
.p3d
.ply
.pvd
.pvti
.pvtk
.pvtr
.pvtu
.stl
.tri
.vti
.vtk
.vtm
.vtmb
.vtp
.vtr
.vts
.vtu
- Parameters
- filename
str
The string path to the file to read.
- filename
- Returns
pyvista.BaseReader
A subclass of
pyvista.BaseReader
is returned based on file type.
Examples
>>> import pyvista >>> from pyvista import examples >>> filename = examples.download_human(load=False) >>> filename.split("/")[-1] # omit the path 'Human.vtp' >>> reader = pyvista.get_reader(filename) >>> reader XMLPolyDataReader('.../Human.vtp') >>> mesh = reader.read() >>> mesh PolyData ... >>> mesh.plot(color='tan')