4 SetCurrentStudy(salome.myStudy)
6 # make geometry of a box
7 box = geompy.MakeBoxDXDYDZ(100,100,100)
8 face = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])[0]
12 localAlgo = mesh.Triangle(face)
13 mesh.AutomaticHexahedralization()
16 fGroup = mesh.GroupOnGeom( face, "2D on face")
17 nGroup = mesh.GroupOnGeom( face, "nodes on face", NODE)
18 subMesh = localAlgo.GetSubMesh()
20 # make a new mesh by copying different parts of the mesh
22 # 1. copy the whole mesh
23 newMesh = CopyMesh( mesh, "whole mesh copy")
25 # 2. copy a group of 2D elements along with groups
26 newMesh = CopyMesh( fGroup, "face group copy with groups",toCopyGroups=True)
28 # 3. copy a group of nodes with preseving their ids
29 newMesh = CopyMesh( nGroup, "node group copy", toKeepIDs=True)
32 faceIds = fGroup.GetIDs()[-10:]
33 newMesh = CopyMesh( mesh.GetIDSource( faceIds, FACE ), "some faces copy")
36 nodeIds = nGroup.GetIDs()[-10:]
37 newMesh = CopyMesh( mesh.GetIDSource( nodeIds, NODE), "some nodes copy")
40 newMesh = CopyMesh( subMesh, "submesh copy" )