2015-03-03 17:03:38 +05:00
|
|
|
# Creating groups of entities basing on nodes of other groups
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
import SMESH_mechanic
|
2017-01-24 15:16:37 +05:00
|
|
|
import SMESH, SALOMEDS
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
smesh = SMESH_mechanic.smesh
|
|
|
|
mesh = SMESH_mechanic.mesh
|
|
|
|
salome = SMESH_mechanic.salome
|
|
|
|
|
|
|
|
# Criterion : AREA > 100
|
2013-04-04 13:08:19 +06:00
|
|
|
aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 100.)
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# create a group by adding elements with area > 100
|
2015-03-03 17:03:38 +05:00
|
|
|
aSrcGroup1 = mesh.GroupOnFilter(SMESH.FACE, "Area > 100", aFilter)
|
2017-01-23 22:08:38 +05:00
|
|
|
aSrcGroup1.SetColor( SALOMEDS.Color(1.,1.,0.))
|
2017-03-20 17:27:30 +05:00
|
|
|
print("Criterion: Area > 100, Nb = ", aSrcGroup1.Size())
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# Criterion : AREA < 30
|
2013-04-04 13:08:19 +06:00
|
|
|
aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 30.)
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# create a group by adding elements with area < 30
|
2015-03-03 17:03:38 +05:00
|
|
|
aSrcGroup2 = mesh.GroupOnFilter(SMESH.FACE, "Area < 30", aFilter)
|
2017-01-23 22:08:38 +05:00
|
|
|
aSrcGroup2.SetColor( SALOMEDS.Color(1.,0.,0.))
|
2017-03-20 17:27:30 +05:00
|
|
|
print("Criterion: Area < 30, Nb = ", aSrcGroup2.Size())
|
2015-03-03 17:03:38 +05:00
|
|
|
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# Create group of edges using source groups of faces
|
2013-04-04 13:08:19 +06:00
|
|
|
aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.EDGE, "Edges" )
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# Create group of nodes using source groups of faces
|
2013-04-04 13:08:19 +06:00
|
|
|
aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.NODE, "Nodes" )
|
2013-02-12 20:37:44 +06:00
|
|
|
|
2017-06-13 15:01:10 +05:00
|
|
|
salome.sg.updateObjBrowser()
|