smesh/doc/salome/examples/transforming_meshes_ex05.py
eap 64680c27c1 23617: EDF 14133 - Complete Merge Nodes / Merge Elements operations
+
1) fix bug that SMESH_MeshEditor::DoubleElements() can't duplicate all
   elements if they are of different dimension
2) Add QString GetName( Handle(SALOME_InteractiveObject)& ) that gets
   missing name from SObject.
2019-01-18 21:31:22 +03:00

25 lines
793 B
Python

# Merging Nodes
import SMESH_mechanic, SMESH
mesh = SMESH_mechanic.mesh
smesh = SMESH_mechanic.smesh
# criterion of coincidence
Tolerance = 4.0
# find close nodes of triangle elements only
triangleFilter = smesh.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)