8 from salome.geom import geomBuilder
9 geompy = geomBuilder.New(salome.myStudy)
11 import SMESH, SALOMEDS
12 from salome.smesh import smeshBuilder
13 smesh = smeshBuilder.New(salome.myStudy)
14 import salome_notebook
17 # create an empty mesh structure
20 # a method to build a polygonal mesh element with <nb_vert> angles:
21 def MakePolygon (a_mesh, x0, y0, z0, radius, nb_vert):
22 al = 2.0 * math.pi / nb_vert
25 # Create nodes for a polygon
26 for ii in range(nb_vert):
27 nid = mesh.AddNode(x0 + radius * math.cos(ii*al),
28 y0 + radius * math.sin(ii*al),
34 return mesh.AddPolygonalFace(node_ids)
36 # Create three polygons
37 f1 = MakePolygon(mesh, 0, 0, 0, 30, 13)
38 f2 = MakePolygon(mesh, 0, 0, 10, 21, 9)
39 f3 = MakePolygon(mesh, 0, 0, 20, 13, 6)
41 salome.sg.updateObjBrowser(1)