# Examples from pyvista.DataSetFilters.remove_cells
# =================================================

# Remove 20 cells from an unstructured grid.
from pyvista import examples
import pyvista as pv
hex_mesh = pv.read(examples.hexbeamfile)
removed = hex_mesh.remove_cells(range(10, 20))
removed.plot(color='lightblue', show_edges=True, line_width=3)

# Remove cells from `PolyData`. The output is also `PolyData`.
sphere = pv.Sphere()
removed = sphere.remove_cells(range(100))
removed.n_cells, sphere.n_cells
type(removed)

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