# Examples from pyvista.ImageData.bounding_sphere
# ===============================================

# Get the bounding sphere geometry of a mesh.
import pyvista as pv
from pyvista import examples
mesh = examples.load_airplane()
radius, center = mesh.bounding_sphere

# Create a sphere and plot it along with the original mesh.
sphere = pv.Icosphere(radius=radius, center=center)
pl = pv.Plotter()
_ = pl.add_mesh(mesh)
_ = pl.add_mesh(sphere, style='wireframe', color='black')
pl.view_xy()
pl.camera.zoom(1.5)
pl.show()

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

