Note
Click here to download the full example code
Surface Smoothing#
Smoothing rough edges of a surface mesh
from pyvista import examples
Suppose you extract a volumetric subset of a dataset that has roughly defined
edges. Perhaps you’d like a smooth representation of that model region. This
can be achieved by extracting the bounding surface of the volume and applying
a pyvista.PolyData.smooth()
filter.
The below code snippet loads a sample roughly edged volumetric dataset:

Extract the outer surface of the volume using the
pyvista.DataSetFilters.extract_geometry()
filter and then apply the
smoothing filter:

Not smooth enough? Try increasing the number of iterations for the Laplacian smoothing algorithm:

Still not smooth enough? Increase the number of iterations for the Laplacian smoothing algorithm to a crazy high value:

Total running time of the script: ( 0 minutes 1.293 seconds)