DataSet.find_cells_intersecting_line#
- DataSet.find_cells_intersecting_line( ) NumpyArray[int][source]#
Find the index of cells that intersect a line.
Line is defined from
pointatopointb.Warning
This filter internally builds and caches a vtkStaticCellLocator. If the mesh’s geometry is modified, the cache will no longer be valid.
- Parameters:
- Returns:
numpy.ndarrayIndex or indices of the cell(s) that intersect the line.
Examples#
Download Python source code | Download Jupyter notebook
>>> import pyvista as pv
>>> mesh = pv.Sphere()
>>> cell_ids = mesh.find_cells_intersecting_line([0.0, 0, 0], [1.0, 0, 0])
>>> sorted(cell_ids.tolist())
[86, 1653]