save_meshio

save_meshio(filename, mesh, file_format=None, **kwargs)

Save mesh to file using meshio.

Parameters
filenamestr

Filename to save the mesh to.

meshpyvista.DataSet

Any PyVista mesh/spatial data type.

file_formatstr, optional

File type for meshio to save. For example '.bdf'. This is normally inferred from the extension but this can be overridden.

**kwargsdict, optional

Additional keyword arguments. See meshio.write_points_cells for more details.

Examples

Save a pyvista sphere to a Abaqus data file.

>>> import pyvista
>>> sphere = pyvista.Sphere()
>>> pyvista.save_meshio('mymesh.inp', sphere)