pyvista.to_meshio

Contents

pyvista.to_meshio#

to_meshio(mesh: DataSet) meshio.Mesh[source]#

Convert a PyVista mesh to a meshio mesh instance.

Added in version 0.45.

Parameters:
meshpyvista.DataSet

Any PyVista mesh/spatial data type.

Returns:
meshio.Mesh

A mesh instance from the meshio library.

Raises:
ImportError

If the meshio package is not installed.

Examples

Convert a pyvista sphere to a meshio mesh instance.

>>> import pyvista as pv
>>> sphere = pv.Sphere()
>>> mesh = pv.to_meshio(sphere)