2013-02-12 14:37:44 +00:00
|
|
|
# Free Edges
|
|
|
|
|
2022-04-11 16:28:01 +03:00
|
|
|
from mechanic import *
|
2013-02-12 14:37:44 +00:00
|
|
|
|
2022-04-11 16:28:01 +03:00
|
|
|
aFilterMgr = smesh_builder.CreateFilterManager()
|
2013-02-12 14:37:44 +00:00
|
|
|
|
|
|
|
# Remove some elements to obtain free edges
|
|
|
|
# Criterion : AREA > 95.
|
|
|
|
area_margin = 95.
|
|
|
|
|
2022-04-11 16:28:01 +03:00
|
|
|
aFilter = smesh_builder.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, area_margin)
|
2013-02-12 14:37:44 +00:00
|
|
|
|
|
|
|
anIds = mesh.GetIdsFromFilter(aFilter)
|
|
|
|
|
|
|
|
mesh.RemoveElements(anIds)
|
|
|
|
|
|
|
|
# Criterion : Free Edges
|
|
|
|
aBorders = mesh.GetFreeBorders()
|
|
|
|
|
|
|
|
# create groups
|
2013-04-04 07:08:19 +00:00
|
|
|
aGroupF = mesh.CreateEmptyGroup(SMESH.FACE, "Faces with free edges")
|
|
|
|
aGroupN = mesh.CreateEmptyGroup(SMESH.NODE, "Nodes on free edges")
|
2013-02-12 14:37:44 +00:00
|
|
|
|
|
|
|
# fill groups with elements, corresponding to the criterion
|
2017-03-20 13:27:30 +01:00
|
|
|
print("")
|
|
|
|
print("Criterion: Free edges Nb = ", len(aBorders))
|
2013-02-12 14:37:44 +00:00
|
|
|
for i in range(len(aBorders)):
|
|
|
|
aBorder = aBorders[i]
|
2017-03-20 13:27:30 +01:00
|
|
|
print("Face # ", aBorder.myElemId, " : Edge between nodes (", end=' ')
|
|
|
|
print(aBorder.myPnt1, ", ", aBorder.myPnt2, ")")
|
2013-02-12 14:37:44 +00:00
|
|
|
|
|
|
|
aGroupF.Add([aBorder.myElemId])
|
|
|
|
aGroupN.Add([aBorder.myPnt1, aBorder.myPnt2])
|