Conversions

Conversions#

These functions convert between PyVista datasets and the objects of VTK and other mesh libraries. To read or write a file, see Readers and Writers and save().

See also

Wrapping Other Objects

Wrap trimesh and VTK objects.

Transitioning From VTK to PyVista

How PyVista’s interface relates to VTK’s.

Wrapping VTK Objects#

is_pyvista_dataset(obj)

Return True if the object is a PyVista wrapped dataset.

wrap(...)

Wrap any given VTK data object to its appropriate PyVista data object.

Meshio#

from_meshio(mesh)

Convert a meshio mesh instance to a PyVista mesh.

is_meshio_mesh(obj)

Test if passed object is an instance of meshio.Mesh.

read_meshio(filename[, file_format])

Read any mesh file using meshio.

save_meshio(filename, mesh[, file_format])

Save mesh to file using meshio.

to_meshio(mesh)

Convert a PyVista mesh to a meshio mesh instance.

Trimesh#

from_trimesh(mesh, *[, pass_data])

Convert a Trimesh mesh to a PyVista mesh.

is_trimesh_mesh(obj)

Test if passed object is an instance of trimesh.Trimesh.

to_trimesh(mesh, *[, triangulate, pass_data])

Convert a PyVista mesh to a Trimesh mesh.