connectivity#
- DataSetFilters.connectivity(largest=False, progress_bar=False)[source]#
Find and label connected bodies/volumes.
This adds an ID array to the point and cell data to distinguish separate connected bodies. This applies a
vtkConnectivityFilter
filter which extracts cells that share common points and/or meet other connectivity criterion.Cells that share vertices and meet other connectivity criterion such as scalar range are known as a region.
- Parameters:
- Returns:
pyvista.DataSet
Dataset with labeled connected bodies. Return type matches input.
Examples
Join two meshes together and plot their connectivity.
>>> import pyvista >>> mesh = pyvista.Sphere() + pyvista.Sphere(center=(2, 0, 0)) >>> conn = mesh.connectivity(largest=False) >>> conn.plot(cmap=['red', 'blue'])
See Volumetric Analysis for more examples using this filter.