Use the connectivity filter to remove noisy isosurfaces.
This example is very similar to this VTK example
# sphinx_gallery_thumbnail_number = 2 import pyvista as pv from pyvista import examples
Load a dataset that has noisy isosurfaces
The mesh plotted above is very noisy. We can extract the largest connected
isosurface in that mesh using the
filter and passing
largest=True to the
filter or by using the
(both are equivalent).
# Grab the largest connected volume present largest = mesh.connectivity(largest=True) # or: largest = mesh.extract_largest() p = pv.Plotter() p.add_mesh(largest, color='#965434') p.add_mesh(mesh.outline()) p.camera_position = cpos p.show()
Total running time of the script: ( 0 minutes 0.412 seconds)