Salome HOME
Merge from V6_main 11/02/2013
[modules/smesh.git] / doc / salome / examples / modifying_meshes_ex21.py
1 # Smoothing
2
3 import salome
4 import geompy
5
6 import SMESH_mechanic
7
8 smesh = SMESH_mechanic.smesh
9 mesh = SMESH_mechanic.mesh
10
11 # select the top face
12 faces = geompy.SubShapeAllSorted(SMESH_mechanic.shape_mesh, geompy.ShapeType["FACE"])
13 face = faces[3]
14 geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, face, "face planar with hole")
15
16 # create a group of faces to be smoothed
17 GroupSmooth = mesh.GroupOnGeom(face, "Group of faces (smooth)", smesh.FACE)
18
19 # perform smoothing
20
21 # boolean SmoothObject(Object, IDsOfFixedNodes, MaxNbOfIterations, MaxAspectRatio, Method)
22 res = mesh.SmoothObject(GroupSmooth, [], 20, 2., smesh.CENTROIDAL_SMOOTH)
23 print "\nSmoothing ... ",
24 if not res: print "failed!"
25 else:       print "done."
26
27 salome.sg.updateObjBrowser(1)