5 salome.salome_init_without_session()
7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New()
10 import SMESH, SALOMEDS
11 from salome.smesh import smeshBuilder
12 smesh = smeshBuilder.New()
16 #smesh = SMESH_mechanic.smesh
17 mesh = SMESH_mechanic.mesh
20 faces = geompy.SubShapeAllSorted(SMESH_mechanic.shape_mesh, geompy.ShapeType["FACE"])
22 geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, face, "face planar with hole")
24 # create a group of faces to be smoothed
25 GroupSmooth = mesh.GroupOnGeom(face, "Group of faces (smooth)", SMESH.FACE)
29 # boolean SmoothObject(Object, IDsOfFixedNodes, MaxNbOfIterations, MaxAspectRatio, Method)
30 res = mesh.SmoothObject(GroupSmooth, [], 20, 2., smesh.CENTROIDAL_SMOOTH)
31 print("\nSmoothing ... ", end=' ')
32 if not res: print("failed!")
35 salome.sg.updateObjBrowser()