pyvista.DataSetFilters.extract_largest#

DataSetFilters.extract_largest(inplace=False, progress_bar=False)[source]#

Extract largest connected set in mesh.

Can be used to reduce residues obtained when generating an isosurface. Works only if residues are not connected (share at least one point with) the main component of the image.

Parameters:
inplacebool, default: False

Updates mesh in-place.

progress_barbool, default: False

Display a progress bar to indicate progress.

Returns:
pyvista.DataSet

Largest connected set in the dataset. Return type matches input.

Examples

Join two meshes together, extract the largest, and plot it.

>>> import pyvista as pv
>>> mesh = pv.Sphere() + pv.Cube()
>>> largest = mesh.extract_largest()
>>> largest.plot()
../../../_images/pyvista-DataSetFilters-extract_largest-1_00_00.png

See Connectivity and Volumetric Analysis for more examples using this filter.