# Examples from pyvista.UnstructuredGridFilters.remove_unused_points
# ==================================================================

# Create `UnstructuredGrid` with three points. The first two points are
# coincident and associated with `VERTEX` cells, and the third point
# is "unused" and not associated with any cells.
import pyvista as pv
cells = [1, 0, 1, 1]
celltypes = [pv.CellType.VERTEX, pv.CellType.VERTEX]
points = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [1.0, 1.0, 1.0]]
grid = pv.UnstructuredGrid(cells, celltypes, points)
grid

# Since the third point is unused, we can remove it. Note that coincident points are not
# merged by this filter, so the two vertex points are kept as-is.
grid = grid.remove_unused_points()
grid

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