--- /dev/null
+from __future__ import division\r
+\r
+from salome.geom import geomBuilder\r
+from salome.smesh import smeshBuilder\r
+\r
+import sys\r
+import os\r
+\r
+from math import pi, cos, sin\r
+\r
+geompy = geomBuilder.New()\r
+smesh = smeshBuilder.New()\r
+\r
+\r
+def create_group_from(name, mother_shape, list_elem, type="EDGE"):\r
+ new = geompy.CreateGroup(mother_shape, geompy.ShapeType[type])\r
+ geompy.UnionList(new, list_elem)\r
+ new.SetName(name)\r
+ geompy.addToStudyInFather(mother_shape, new, name)\r
+ return new\r
+\r
+\r
+r = 1.\r
+NumberOfSegments = 200\r
+\r
+points = [geompy.MakeVertex(r * cos(i * pi / 3), r * sin(i * pi / 3), 0) for i in range(7)]\r
+edges = [geompy.MakeEdge(points[i], points[i + 1]) for i in range(6)]\r
+wire = geompy.MakeWire(edges)\r
+hexa = geompy.MakeFace(wire, True)\r
+geompy.addToStudy(hexa, "hexa")\r
+g = create_group_from("boundaries", hexa, [geompy.GetInPlace(hexa, wire, 1)])\r
+\r
+mesh = smesh.Mesh(hexa, "mesh")\r
+msurf = mesh.Triangle(algo=smeshBuilder.NETGEN_1D2D)\r
+NETGEN_2D_Simple_Parameters_1 = msurf.Parameters(smeshBuilder.SIMPLE)\r
+NETGEN_2D_Simple_Parameters_1.SetNumberOfSegments( NumberOfSegments )\r
+\r
+mesh.Group(g)\r
+\r
+mesh.Compute()\r
+mesh.ExportMED("meshHexagonWithTriangles"+str(NumberOfSegments)+".med")\r