3 import SMESH_mechanic, SMESH
4 mesh = SMESH_mechanic.mesh
5 smesh = SMESH_mechanic.smesh
7 # criterion of coincidence
10 # find close nodes of triangle elements only
11 triangleFilter = smesh.GetFilter( SMESH.FACE, SMESH.FT_ElemGeomType,'=', SMESH.Geom_TRIANGLE )
12 GroupsOfNodesOfTriangles = mesh.FindCoincidentNodesOnPart([triangleFilter],Tolerance)
14 # prevent nodes located on geom edges from removal during merge:
15 # create a group including all nodes on edges
16 allSegs = mesh.MakeGroup( "all segments", SMESH.EDGE, SMESH.FT_ElemGeomType,'=', SMESH.Geom_EDGE )
18 mesh.MergeNodes(GroupsOfNodesOfTriangles, NodesToKeep=allSegs)
21 # find close nodes in the whole mesh
22 GroupsOfNodes = mesh.FindCoincidentNodes(Tolerance)
24 mesh.MergeNodes(GroupsOfNodes, NodesToKeep=allSegs)