Salome HOME
0023591: [EDF] Add test to check meshing plug-ins to SMESH module
[modules/smesh.git] / doc / salome / examples / modifying_meshes_ex08.py
1 # Add Hexahedron
2
3 import SMESH_mechanic
4
5 mesh = SMESH_mechanic.mesh
6 print("")
7
8 # add nodes
9 nId1 = mesh.AddNode(50, 10, 0)
10 nId2 = mesh.AddNode(47, 12, 0)
11 nId3 = mesh.AddNode(50, 10, 10)
12 nId4 = mesh.AddNode(47, 12, 10)
13
14 if nId1 == 0 or nId2 == 0 or nId3 == 0 or nId4 == 0: print("KO node addition.")
15
16 # add hexahedron
17 vId = mesh.AddVolume([nId2, nId1, 38, 39, nId4, nId3, 245, 246])
18 if vId == 0: print("KO Hexahedron addition.")
19 else:        print("New Hexahedron has been added with ID ", vId)