pyvista.DataSetFilters.extract_points#
- DataSetFilters.extract_points(
- ind: int | VectorLike[int] | VectorLike[bool],
- adjacent_cells: bool = True,
- include_cells: bool = True,
- progress_bar: bool = False,
Return a subset of the grid (with cells) that contains any of the given point indices.
- Parameters:
- indsequence[
int] Sequence of point indices to be extracted.
- adjacent_cellsbool, default:
True 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. Has no effect ifinclude_cellsisFalse.- include_cellsbool, default:
True Specifies if the cells shall be returned or not.
- progress_barbool, default:
False Display a progress bar to indicate progress.
- indsequence[
- Returns:
pyvista.UnstructuredGridSubselected grid.
See also
Examples
Extract all the points of a sphere with a Z coordinate greater than 0
>>> import pyvista as pv >>> sphere = pv.Sphere() >>> extracted = sphere.extract_points( ... sphere.points[:, 2] > 0, include_cells=False ... ) >>> extracted.clear_data() # clear for plotting >>> extracted.plot()