smesh/doc/examples/transforming_meshes_ex05.py

22 lines
737 B
Python
Raw Permalink Normal View History

2013-02-12 20:37:44 +06:00
# Merging Nodes
2022-04-11 18:28:01 +05:00
from mechanic import *
2013-02-12 20:37:44 +06:00
# criterion of coincidence
Tolerance = 4.0
# find close nodes of triangle elements only
2022-04-11 18:28:01 +05:00
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 )
2013-02-12 20:37:44 +06:00
mesh.MergeNodes(GroupsOfNodesOfTriangles, NodesToKeep=allSegs)
# find close nodes in the whole mesh
GroupsOfNodes = mesh.FindCoincidentNodes(Tolerance)
mesh.MergeNodes(GroupsOfNodes, NodesToKeep=allSegs)