remove_points

PolyDataFilters.remove_points(remove, mode='any', keep_scalars=True, inplace=False)

Rebuild a mesh by removing points.

Only valid for all-triangle meshes.

Parameters
removenp.ndarray

If remove is a bool array, points that are True will be removed. Otherwise, it is treated as a list of indices.

modestr, optional

When 'all', only faces containing all points flagged for removal will be removed. Default 'any'.

keep_scalarsbool, optional

When True, point and cell scalars will be passed on to the new mesh.

inplacebool, optional

Updates mesh in-place. Defaults to False.

Returns
pyvista.PolyData

Mesh without the points flagged for removal.

numpy.ndarray

Indices of new points relative to the original mesh.

Examples

Remove the first 100 points from a sphere.

>>> import pyvista as pv
>>> sphere = pv.Sphere()
>>> reduced_sphere, ridx = sphere.remove_points(range(100, 250))
>>> reduced_sphere.plot(show_edges=True, line_width=3)
../../../_images/pyvista-PolyDataFilters-remove_points-1_00_00.png