Smooth surface¶
Description¶
Smooths a surface base using the Gaussian filter implemented in the SmoothPolyData filter of VTK
Parameters¶
- base
Base
The input base to be smoothed
- base
- nb_iterationsint, default= 10
The number of iteration of the smoothing algorithm
- boundary_smoothingbool, default=
True
If the smoothing algorithm should be also applied to the edges of the surface.
- boundary_smoothingbool, default=
Preconditions¶
All the zones of the base must have ‘tri’ and/or ‘qua’ elements
Postconditions¶
The output base has as many zones, instants, and variables as the input base. If the zone geometry is shared, the smoothed zone geometry will also be shared.
Warning
The cell order of the input and output base might not be identical.
Example¶
import antares
myt = antares.Treatment('smoothsurface')
myt['base'] = base
myt['nb_iterations'] = 1000
smoothed_base = myt.execute()
or
import antares
smoothed_base = antares.treatment.SmoothSurface(base=base, nb_iterations=1000)
Example¶
The following example shows how to smooth a sample rough surface
import antares
import os
output_folder = os.path.join("OUTPUT", "TreatmentSmoothSurface")
os.makedirs(output_folder, exist_ok=True)
reader = antares.Reader('hdf_antares')
reader['filename'] = os.path.join('..', 'data', 'ROUGHSURFACE', 'roughsurface.h5')
base = reader.read()
treatment = antares.Treatment('SmoothSurface')
treatment['base'] = base
treatment['nb_iterations'] = 1000
smoothed_surface = treatment.execute()
writer = antares.Writer('hdf_antares')
writer['base'] = smoothed_surface
writer['filename'] = os.path.join(output_folder, 'smooth_surface')
writer.dump()