]> SALOME platform Git repositories - modules/smesh.git/blob - doc/salome/examples/transforming_meshes_ex07.py
Salome HOME
[bos #23982] EDF 22984 - aspect ratio of hexa
[modules/smesh.git] / doc / salome / examples / transforming_meshes_ex07.py
1 # Sew Meshes Border to Side
2
3
4 import salome
5 salome.salome_init()
6 import GEOM
7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New()
9
10 import SMESH, SALOMEDS
11 from salome.smesh import smeshBuilder
12 smesh =  smeshBuilder.New()
13
14 # create two faces of a box
15 box1 = geompy.MakeBox(0., 0., -10., 30., 20., 25.)
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(9)
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 border to side
43 # FirstNodeIDOnFreeBorder, SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder,
44 # FirstNodeIDOnSide, LastNodeIDOnSide,
45 # CreatePolygons, CreatePolyedrs
46 mesh.SewBorderToSide(5, 45, 6, 113, 109, 0, 0)