8 # create an empty mesh structure
11 # a method to build a polygonal mesh element with <nb_vert> angles:
12 def MakePolygon (a_mesh, x0, y0, z0, radius, nb_vert):
13 al = 2.0 * math.pi / nb_vert
16 # Create nodes for a polygon
17 for ii in range(nb_vert):
18 nid = mesh.AddNode(x0 + radius * math.cos(ii*al),
19 y0 + radius * math.sin(ii*al),
25 return mesh.AddPolygonalFace(node_ids)
27 # Create three polygons
28 f1 = MakePolygon(mesh, 0, 0, 0, 30, 13)
29 f2 = MakePolygon(mesh, 0, 0, 10, 21, 9)
30 f3 = MakePolygon(mesh, 0, 0, 20, 13, 6)
32 salome.sg.updateObjBrowser(1)