mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-29 10:50:34 +05:00
64680c27c1
+ 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.
25 lines
793 B
Python
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)
|