X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Ftransforming_meshes_ex11.py;h=de98b27bb2bd361856f195f69a9d999ae100913c;hp=0c3bee898a13099c343063bf4a2144d65d50a4a5;hb=13b8c96957cd060f6e76f73c9248b941beff0d6d;hpb=1227aa421b394e8a149d05f23149fd973208d84c diff --git a/doc/salome/examples/transforming_meshes_ex11.py b/doc/salome/examples/transforming_meshes_ex11.py index 0c3bee898..de98b27bb 100644 --- a/doc/salome/examples/transforming_meshes_ex11.py +++ b/doc/salome/examples/transforming_meshes_ex11.py @@ -1,13 +1,14 @@ -# Duplicate nodes +# Duplicate nodes or/and elements import salome salome.salome_init() + import GEOM from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) -import SMESH, SALOMEDS +import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) @@ -24,7 +25,7 @@ mesh.Hexahedron() # Compute mesh mesh.Compute() -# Without the duplication of border elements +# Duplicate nodes only # Nodes to duplicate nodes1 = mesh.CreateEmptyGroup( SMESH.NODE, 'nodes1' ) @@ -48,7 +49,7 @@ print "Nodes : ", mesh.NbNodes() print "Edges : ", mesh.NbEdges() print "Quadrangles : ", mesh.NbQuadrangles() -# With the duplication of border elements +# Duplicate nodes and border elements # Edges to duplicate edges = mesh.CreateEmptyGroup( SMESH.EDGE, 'edges' ) @@ -76,6 +77,19 @@ print "Nodes : ", mesh.NbNodes() print "Edges : ", mesh.NbEdges() print "Quadrangles : ", mesh.NbQuadrangles() + +# Duplicate elements only + +# Duplicate all faces and make a group of new faces. +# If a mesh is given to DoubleElements(), all elements of the greatest dimension are duplicated +newFacesGroup = mesh.DoubleElements( mesh, "newFacesGroup" ) + +# Duplicate edges contained in the group "edges" and add new edges to this group +mesh.DoubleElements( edges, edges.GetName() ) + +# Duplicate two first edges of the mesh +mesh.DoubleElements([ 1, 2 ]) + # Update object browser if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0)