mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-15 01:58:35 +05:00
42e25f073b
Add support to periodic faces to the laplacian smoother. . Add support to periodic faces to the centroidalSmooth. Do not move singular nodes that are placed in the surface instead of on the edge as in the BodyFitting algorithm. Small modif in averageByElement to not initialize theUVMap unproperly when theSurface.IsNull().
19 lines
646 B
Python
19 lines
646 B
Python
# Smoothing
|
|
|
|
from mechanic import *
|
|
|
|
# select the top face
|
|
faces = geom_builder.SubShapeAllSorted(mechanic, geom_builder.ShapeType["FACE"])
|
|
|
|
# create a group of faces to be smoothed
|
|
group_smooth = mesh.GroupOnGeom(faces[3], "Group of faces (smooth)", SMESH.FACE)
|
|
|
|
# perform smoothing
|
|
|
|
# boolean SmoothObject(Object, IDsOfFixedNodes, MaxNbOfIterations, MaxAspectRatio, Method)
|
|
res0 = mesh.SmoothObject(group_smooth, [], 20, 2., smesh_builder.CENTROIDAL_SMOOTH)
|
|
res1 = mesh.SmoothObject(group_smooth, [], 20, 2., smesh_builder.LAPLACIAN_SMOOTH)
|
|
print("\nSmoothing ... ", end=' ')
|
|
if not (res0 and res1): print("failed!")
|
|
else: print("done.")
|