read(filename, force_ext=None, file_format=None, progress_bar=False)[source]#

Read any file type supported by vtk or meshio.

Automatically determines the correct reader to use then wraps the corresponding mesh as a pyvista object. Attempts native vtk readers first then tries to use meshio.

See pyvista.get_reader() for list of formats supported.


See nschloe/meshio for formats supported by meshio. Be sure to install meshio with pip install meshio if you wish to use it.


The string path to the file to read. If a list of files is given, a pyvista.MultiBlock dataset is returned with each file being a separate block in the dataset.

force_extstr, optional

If specified, the reader will be chosen by an extension which is different to its actual extension. For example, '.vts', '.vtu'.

file_formatstr, optional

Format of file to read with meshio.

progress_barbool, default: False

Optionally show a progress bar. Ignored when using meshio.


Wrapped PyVista dataset.


Load an example mesh.

>>> import pyvista as pv
>>> from pyvista import examples
>>> mesh =
>>> mesh.plot(cpos='xz')

Load a vtk file.

>>> mesh ='my_mesh.vtk')  

Load a meshio file.

>>> mesh ="mesh.obj")