7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New()
10 import SMESH, SALOMEDS
11 from salome.smesh import smeshBuilder
12 smesh = smeshBuilder.New()
15 box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
16 idbox = geompy.addToStudy(box, "box")
19 mesh = smesh.Mesh(box, "Mesh_free_nodes")
21 algo.NumberOfSegments(10)
22 algo = mesh.Triangle(smeshBuilder.MEFISTO)
23 algo.MaxElementArea(150.)
26 # Remove some elements to obtain free nodes
27 # Criterion : AREA < 80.
30 aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, area_margin)
32 anIds = mesh.GetIdsFromFilter(aFilter)
34 mesh.RemoveElements(anIds)
36 # criterion : free nodes
37 aFilter = smesh.GetFilter(SMESH.NODE, SMESH.FT_FreeNodes)
38 anNodeIds = mesh.GetIdsFromFilter(aFilter)
41 aGroup = mesh.CreateEmptyGroup(SMESH.NODE, "Free_nodes")
45 print("Criterion: Free nodes Nb = ", len(anNodeIds))
47 for i in range(len(anNodeIds)):
48 if j > 20: j = 1; print("")
49 print(anNodeIds[i], end=' ')
54 salome.sg.updateObjBrowser()