# Examples from pyvista.read
# ==========================

# Load an example mesh.
import pyvista as pv
from pyvista import examples
mesh = pv.read(examples.antfile)
mesh.plot(cpos='xz')

# Narrow the return type to a specific class. This avoids the need for
# a manual `cast` when working with type checkers such as `mypy`
# or `pyright`.
mesh = pv.read('mesh.vtu', cls=pv.UnstructuredGrid)

# Load a vtk file.
mesh = pv.read('my_mesh.vtk')

# Load a meshio file.
mesh = pv.read('mesh.obj')

# Load a `.foam` file and use keyword arguments to set reader-specific properties
# such as `skip_zero_time`.
file = examples.download_openfoam_tubes(load=False)
mesh = pv.read(file, skip_zero_time=True)

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

