mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-11 16:19:16 +05:00
22 lines
737 B
Python
22 lines
737 B
Python
# Merging Nodes
|
|
|
|
from mechanic import *
|
|
|
|
# criterion of coincidence
|
|
Tolerance = 4.0
|
|
|
|
# find close nodes of triangle elements only
|
|
triangleFilter = smesh_builder.GetFilter( SMESH.FACE, SMESH.FT_ElemGeomType,'=', SMESH.Geom_TRIANGLE )
|
|
GroupsOfNodesOfTriangles = mesh.FindCoincidentNodesOnPart([triangleFilter],Tolerance)
|
|
|
|
# prevent nodes located on geom edges from removal during merge:
|
|
# create a group including all nodes on edges
|
|
allSegs = mesh.MakeGroup( "all segments", SMESH.EDGE, SMESH.FT_ElemGeomType,'=', SMESH.Geom_EDGE )
|
|
|
|
mesh.MergeNodes(GroupsOfNodesOfTriangles, NodesToKeep=allSegs)
|
|
|
|
# find close nodes in the whole mesh
|
|
GroupsOfNodes = mesh.FindCoincidentNodes(Tolerance)
|
|
|
|
mesh.MergeNodes(GroupsOfNodes, NodesToKeep=allSegs)
|