PolyDataFilters.fill_holes#
- PolyDataFilters.fill_holes( ) PolyData[source]#
Fill holes in a
pyvista.PolyDataor vtkPolyData object.Holes are identified by locating boundary edges, linking them together into loops, and then triangulating the resulting loops. Note that you can specify an approximate limit to the size of the hole that can be filled.
Warning
This method is known to segfault. Use at your own risk.
- Parameters:
- hole_size
float Specifies the maximum hole size to fill. This is represented as a radius to the bounding circumsphere containing the hole. Note that this is an approximate area; the actual area cannot be computed without first triangulating the hole.
- inplacebool, default:
False Return new mesh or overwrite input.
- progress_barbool, default:
False Display a progress bar to indicate progress.
- hole_size
- Returns:
pyvista.PolyDataMesh with holes filled if
inplace=False.
Examples#
Download Python source code | Download Jupyter notebook
Create a partial sphere with a hole and then fill it.
>>> import pyvista as pv
>>> sphere_with_hole = pv.Sphere(end_theta=330)
>>> sphere = sphere_with_hole.fill_holes(1000)
>>> edges = sphere.extract_feature_edges(
... feature_edges=False, manifold_edges=False
... )
>>> assert edges.n_cells == 0
Used In#
Gallery Examples