Remove Cells#
Download Python source code | Download Jupyter notebook
Remove specific cells from a mesh.
Cells can be removed from any dataset by index or with a boolean mask using
remove_cells(). The output is a
PolyData for PolyData input and an
UnstructuredGrid otherwise.
from pyvista import examples
mesh = examples.load_channels()
Decide which cells to remove with a criterion (feel free to adjust this or manually create this array to remove specific cells).
Remove the cells and plot the result.
mesh = mesh.remove_cells(remove)
mesh.plot(clim=[0, 4])

Total running time of the script: (0 minutes 3.682 seconds)