extract_points#
- PolyDataFilters.extract_points(ind, adjacent_cells=True, include_cells=True, progress_bar=False)#
Return a subset of the grid (with cells) that contains any of the given point indices.
- Parameters
- ind
np.ndarray
,list
,or
sequence Numpy array of point indices to be extracted.
- adjacent_cellsbool,
optional
If
True
, extract the cells that contain at least one of the extracted points. IfFalse
, extract the cells that contain exclusively points from the extracted points list. The default isTrue
.- include_cellsbool,
optional
Specifies if the cells shall be returned or not. The default is
True
.- progress_barbool,
optional
Display a progress bar to indicate progress.
- ind
- Returns
pyvista.UnstructuredGrid
Subselected grid.
Examples
Extract all the points of a sphere with a Z coordinate greater than 0
>>> import pyvista >>> sphere = pyvista.Sphere() >>> extracted = sphere.extract_points(sphere.points[:, 2] > 0) >>> extracted.clear_data() # clear for plotting >>> extracted.plot()