]> SALOME platform Git repositories - modules/smesh.git/blob - doc/salome/examples/transforming_meshes_ex08.py
Salome HOME
update of messages
[modules/smesh.git] / doc / salome / examples / transforming_meshes_ex08.py
1 # Sew Conform 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 import salome_notebook
14
15
16 # create two faces of the box
17 box1 = geompy.MakeBox(0., 0., -10., 20., 20., 15.)
18 facesList1 = geompy.SubShapeAll(box1, geompy.ShapeType["FACE"])
19 face1 = facesList1[2]
20
21 box2 = geompy.MakeBox(0., 5., 0., 20., 20., 15.)
22 facesList2 = geompy.SubShapeAll(box2, geompy.ShapeType["FACE"])
23 face2 = facesList2[1]
24
25 edgesList = geompy.SubShapeAll(face2, geompy.ShapeType["EDGE"])
26 edge1 = edgesList[2]
27
28 aComp = geompy.MakeCompound([face1, face2])
29 geompy.addToStudy(aComp, "Two faces")
30
31 # create a mesh on two faces
32 mesh = smesh.Mesh(aComp, "Two faces : quadrangle mesh")
33
34 algo1D = mesh.Segment()
35 algo1D.NumberOfSegments(9)
36 algo2D = mesh.Quadrangle()
37
38 algo_local = mesh.Segment(edge1)
39 algo_local.Arithmetic1D(1, 4)
40 algo_local.Propagation()
41
42 mesh.Compute()
43
44 # sew conform free borders
45 # FirstNodeID1, SecondNodeID1, LastNodeID1, FirstNodeID2, SecondNodeID2
46 mesh.SewConformFreeBorders(5, 45, 6, 3, 24)