1 # Borders at Multiconnection
4 salome.salome_init_without_session()
7 from salome.geom import geomBuilder
8 from salome.smesh import smeshBuilder
10 geom_builder = geomBuilder.New()
11 smesh_builder = smeshBuilder.New()
13 # create open shell: a box without one plane
14 box = geom_builder.MakeBox(0., 0., 0., 20., 20., 15.)
15 FaceList = geom_builder.SubShapeAll(box, geom_builder.ShapeType["FACE"])
16 FaceList.remove(FaceList[5])
17 box = geom_builder.MakeShell(FaceList)
18 idbox = geom_builder.addToStudy(box, "box")
21 mesh = smesh_builder.Mesh(box, "Mesh_borders_at_multi-connections")
23 algo.NumberOfSegments(5)
24 algo = mesh.Triangle()
25 algo.MaxElementArea(20.)
26 if not mesh.Compute(): raise Exception("Error when computing Mesh")
28 # Criterion : Borders at multi-connection
31 aFilter = smesh_builder.GetFilter(SMESH.EDGE, SMESH.FT_MultiConnection, SMESH.FT_EqualTo, nb_conn)
32 anIds = mesh.GetIdsFromFilter(aFilter)
35 print("Criterion: Borders at multi-connections Nb = ", len(anIds))
37 for i in range(len(anIds)):
38 if j > 20: j = 1; print("")
39 print(anIds[i], end=' ')
45 aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Borders at multi-connections")