]> SALOME platform Git repositories - modules/smesh.git/blob - doc/salome/examples/transforming_meshes_ex09.py
Salome HOME
update of messages
[modules/smesh.git] / doc / salome / examples / transforming_meshes_ex09.py
1 # Sew Free Borders
2
3
4 import salome
5 salome.salome_init()
6 import GEOM
7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New(salome.myStudy)
9
10 import SMESH, SALOMEDS
11 from salome.smesh import smeshBuilder
12 smesh =  smeshBuilder.New(salome.myStudy)
13
14 # create two faces of the box
15 box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
16 facesList1 = geompy.SubShapeAll(box1, geompy.ShapeType["FACE"])
17 face1 = facesList1[2]
18
19 box2 = geompy.MakeBox(0., 5., 0., 20., 20., 15.)
20 facesList2 = geompy.SubShapeAll(box2, geompy.ShapeType["FACE"])
21 face2 = facesList2[1]
22
23 edgesList = geompy.SubShapeAll(face2, geompy.ShapeType["EDGE"])
24 edge1 = edgesList[2]
25
26 aComp = geompy.MakeCompound([face1, face2])
27 geompy.addToStudy(aComp, "Two faces")
28
29 # create a mesh on two faces
30 mesh = smesh.Mesh(aComp, "Two faces : quadrangle mesh")
31
32 algo1D = mesh.Segment()
33 algo1D.NumberOfSegments(4)
34 algo2D = mesh.Quadrangle()
35
36 algo_local = mesh.Segment(edge1)
37 algo_local.Arithmetic1D(1, 4)
38 algo_local.Propagation()
39
40 mesh.Compute()
41
42 # sew free borders
43 # FirstNodeID1, SecondNodeID1, LastNodeID1,
44 # FirstNodeID2, SecondNodeID2, LastNodeID2, CreatePolygons, CreatePolyedrs
45 mesh.SewFreeBorders(6, 21, 5, 1, 12, 3, 0, 0)