1 # Borders at Multiconnection 2D
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()
14 # create a compound of two glued boxes
15 box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
16 box2 = geompy.MakeTranslation(box1, 0., 20., 0)
17 comp = geompy.MakeCompound([box1, box2])
18 box = geompy.MakeGlueFaces(comp, 0.000001)
19 idbox = geompy.addToStudy(box, "box")
22 mesh = smesh.Mesh(box, "Box compound : 2D triangle mesh")
24 algo.NumberOfSegments(5)
25 algo = mesh.Triangle()
26 algo.MaxElementArea(20.)
29 # Criterion : MULTI-CONNECTION 2D = 3
32 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_MultiConnection2D, SMESH.FT_EqualTo, nb_conn)
34 anIds = mesh.GetIdsFromFilter(aFilter)
37 print("Criterion: Borders at multi-connection 2D = ", nb_conn, " Nb = ", len(anIds))
39 for i in range(len(anIds)):
40 if j > 20: j = 1; print("")
41 print(anIds[i], end=' ')
47 aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Borders at multi-connection 2D = " + repr(nb_conn))
50 salome.sg.updateObjBrowser()