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:
- 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()
See Connectivity and Volumetric Analysis for more examples using this filter.