7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New(salome.myStudy)
10 import SMESH, SALOMEDS
11 from salome.smesh import smeshBuilder
12 smesh = smeshBuilder.New(salome.myStudy)
14 # create open shell: a box without one plane
15 box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
16 FaceList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
17 FaceList.remove(FaceList[5])
18 box = geompy.MakeShell(FaceList)
19 idbox = geompy.addToStudy(box, "box")
22 mesh = smesh.Mesh(box, "Mesh_Length_2D")
24 algo.NumberOfSegments(5)
25 algo = mesh.Triangle()
26 algo.MaxElementArea(20.)
29 # Criterion : Length 2D > 5.7
32 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Length2D, SMESH.FT_MoreThan, length_margin)
34 anIds = mesh.GetIdsFromFilter(aFilter)
37 print "Criterion: Edges length 2D > ", length_margin, " Nb = ", len(anIds)
39 for i in range(len(anIds)):
40 if j > 20: j = 1; print ""
47 aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Faces with length 2D > " + `length_margin`)
50 salome.sg.updateObjBrowser(1)