1 # Uniting two Triangles
5 salome.salome_init_without_session()
7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New()
10 import SMESH, SALOMEDS
11 from salome.smesh import smeshBuilder
12 smesh = smeshBuilder.New()
13 import salome_notebook
16 # create an empty mesh structure
19 # create the following mesh:
29 ff = [0, 0, 0, 0, 0, 0]
31 bb[0] = mesh.AddNode( 0., 0., 0.)
32 bb[1] = mesh.AddNode(10., 0., 0.)
33 bb[2] = mesh.AddNode(20., 0., 0.)
34 bb[3] = mesh.AddNode(30., 0., 0.)
36 tt[0] = mesh.AddNode( 0., 15., 0.)
37 tt[1] = mesh.AddNode(10., 15., 0.)
38 tt[2] = mesh.AddNode(20., 15., 0.)
39 tt[3] = mesh.AddNode(30., 15., 0.)
41 ff[0] = mesh.AddFace([bb[0], bb[1], tt[1]])
42 ff[1] = mesh.AddFace([bb[0], tt[1], tt[0]])
43 ff[2] = mesh.AddFace([bb[1], bb[2], tt[2]])
44 ff[3] = mesh.AddFace([bb[1], tt[2], tt[1]])
45 ff[4] = mesh.AddFace([bb[2], bb[3], tt[3]])
46 ff[5] = mesh.AddFace([bb[2], tt[3], tt[2]])
48 # delete the diagonal bb[1] - tt[2]
49 print("\nUnite two triangles ... ", end=' ')
50 res = mesh.DeleteDiag(bb[1], tt[2])
51 if not res: print("failed!")
54 salome.sg.updateObjBrowser()