Version: 8.3.0
Home
 All Data Structures Namespaces Files Functions Variables Groups
Transforming meshes (Translation, Rotation, Symmetry, Sewing, Merging)

Functions

def Mirror
 Create a symmetrical copy of mesh elements. More...
 
def MirrorMakeMesh
 Create a new mesh by a symmetrical copy of mesh elements. More...
 
def MirrorObject
 Create a symmetrical copy of the object. More...
 
def MirrorObjectMakeMesh
 Create a new mesh by a symmetrical copy of the object. More...
 
def Translate
 Translate the elements. More...
 
def TranslateMakeMesh
 Create a new mesh of translated elements. More...
 
def TranslateObject
 Translate the object. More...
 
def TranslateObjectMakeMesh
 Create a new mesh from the translated object. More...
 
def Rotate
 Rotate the elements. More...
 
def RotateMakeMesh
 Create a new mesh of rotated elements. More...
 
def RotateObject
 Rotate the object. More...
 
def RotateObjectMakeMesh
 Create a new mesh from the rotated object. More...
 
def FindCoincidentNodes
 Find groups of adjacent nodes within Tolerance. More...
 
def FindCoincidentNodesOnPart
 Find groups of ajacent nodes within Tolerance. More...
 
def MergeNodes
 Merge nodes. More...
 
def FindEqualElements
 Find the elements built on the same nodes. More...
 
def MergeElements
 Merge elements in each given group. More...
 
def MergeEqualElements
 Leave one element and remove all other elements built on the same nodes. More...
 
def FindCoincidentFreeBorders
 Return groups of FreeBorder's coincident within the given tolerance. More...
 
def SewCoincidentFreeBorders
 Sew FreeBorder's of each group. More...
 
def SewFreeBorders
 Sew free borders. More...
 
def SewConformFreeBorders
 Sew conform free borders. More...
 
def SewBorderToSide
 Sew border to side. More...
 
def SewSideElements
 Sew two sides of a mesh. More...
 

Detailed Description

Function Documentation

def Mirror (   self,
  IDsOfElements,
  Mirror,
  theMirrorType = None,
  Copy = 0,
  MakeGroups = False 
)

Create a symmetrical copy of mesh elements.

Parameters
IDsOfElementslist of elements ids
Mirroris AxisStruct or geom object(point, line, plane)
theMirrorTypesmeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE If the Mirror is a geom object this parameter is unnecessary
Copyallows to copy element (Copy is 1) or to replace with its mirroring (Copy is 0)
MakeGroupsforces the generation of new groups from existing ones (if Copy)
Returns
list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise

References Mesh.GetElementsId().

def MirrorMakeMesh (   self,
  IDsOfElements,
  Mirror,
  theMirrorType = 0,
  MakeGroups = 0,
  NewMeshName = "" 
)

Create a new mesh by a symmetrical copy of mesh elements.

Parameters
IDsOfElementsthe list of elements ids
Mirroris AxisStruct or geom object (point, line, plane)
theMirrorTypesmeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE If the Mirror is a geom object this parameter is unnecessary
MakeGroupsto generate new groups from existing ones
NewMeshNamea name of the new mesh to create
Returns
instance of Mesh class

References smeshBuilder.geompyD, Mesh.geompyD, Mesh.GetElementsId(), and Mesh.smeshpyD.

def MirrorObject (   self,
  theObject,
  Mirror,
  theMirrorType = None,
  Copy = 0,
  MakeGroups = False 
)

Create a symmetrical copy of the object.

Parameters
theObjectmesh, submesh or group
MirrorAxisStruct or geom object (point, line, plane)
theMirrorTypesmeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE If the Mirror is a geom object this parameter is unnecessary
Copyallows copying the element (Copy is 1) or replacing it with its mirror (Copy is 0)
MakeGroupsforces the generation of new groups from existing ones (if Copy)
Returns
list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
def MirrorObjectMakeMesh (   self,
  theObject,
  Mirror,
  theMirrorType = 0,
  MakeGroups = 0,
  NewMeshName = "" 
)

Create a new mesh by a symmetrical copy of the object.

Parameters
theObjectmesh, submesh or group
MirrorAxisStruct or geom object (point, line, plane)
theMirrorTypesmeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE If the Mirror is a geom object this parameter is unnecessary
MakeGroupsforces the generation of new groups from existing ones
NewMeshNamethe name of the new mesh to create
Returns
instance of Mesh class

References smeshBuilder.geompyD, Mesh.geompyD, and Mesh.smeshpyD.

def Translate (   self,
  IDsOfElements,
  Vector,
  Copy,
  MakeGroups = False 
)

Translate the elements.

Parameters
IDsOfElementslist of elements ids
Vectorthe direction of translation (DirStruct or vector or 3 vector components)
Copyallows copying the translated elements
MakeGroupsforces the generation of new groups from existing ones (if Copy)
Returns
list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise

References Mesh.GetElementsId().

def TranslateMakeMesh (   self,
  IDsOfElements,
  Vector,
  MakeGroups = False,
  NewMeshName = "" 
)

Create a new mesh of translated elements.

Parameters
IDsOfElementslist of elements ids
Vectorthe direction of translation (DirStruct or vector or 3 vector components)
MakeGroupsforces the generation of new groups from existing ones
NewMeshNamethe name of the newly created mesh
Returns
instance of Mesh class

References smeshBuilder.geompyD, Mesh.geompyD, Mesh.GetElementsId(), and Mesh.smeshpyD.

def TranslateObject (   self,
  theObject,
  Vector,
  Copy,
  MakeGroups = False 
)

Translate the object.

Parameters
theObjectthe object to translate (mesh, submesh, or group)
Vectordirection of translation (DirStruct or geom vector or 3 vector components)
Copyallows copying the translated elements
MakeGroupsforces the generation of new groups from existing ones (if Copy)
Returns
list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
def TranslateObjectMakeMesh (   self,
  theObject,
  Vector,
  MakeGroups = False,
  NewMeshName = "" 
)

Create a new mesh from the translated object.

Parameters
theObjectthe object to translate (mesh, submesh, or group)
Vectorthe direction of translation (DirStruct or geom vector or 3 vector components)
MakeGroupsforces the generation of new groups from existing ones
NewMeshNamethe name of the newly created mesh
Returns
instance of Mesh class

References smeshBuilder.geompyD, Mesh.geompyD, and Mesh.smeshpyD.

def Rotate (   self,
  IDsOfElements,
  Axis,
  AngleInRadians,
  Copy,
  MakeGroups = False 
)

Rotate the elements.

Parameters
IDsOfElementslist of elements ids
Axisthe axis of rotation (AxisStruct or geom line)
AngleInRadiansthe angle of rotation (in radians) or a name of variable which defines angle in degrees
Copyallows copying the rotated elements
MakeGroupsforces the generation of new groups from existing ones (if Copy)
Returns
list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise

References Mesh.GetElementsId(), and smeshBuilder.ParseAngles().

def RotateMakeMesh (   self,
  IDsOfElements,
  Axis,
  AngleInRadians,
  MakeGroups = 0,
  NewMeshName = "" 
)

Create a new mesh of rotated elements.

Parameters
IDsOfElementslist of element ids
Axisthe axis of rotation (AxisStruct or geom line)
AngleInRadiansthe angle of rotation (in radians) or a name of variable which defines angle in degrees
MakeGroupsforces the generation of new groups from existing ones
NewMeshNamethe name of the newly created mesh
Returns
instance of Mesh class

References smeshBuilder.geompyD, Mesh.geompyD, Mesh.GetElementsId(), smeshBuilder.ParseAngles(), and Mesh.smeshpyD.

def RotateObject (   self,
  theObject,
  Axis,
  AngleInRadians,
  Copy,
  MakeGroups = False 
)

Rotate the object.

Parameters
theObjectthe object to rotate( mesh, submesh, or group)
Axisthe axis of rotation (AxisStruct or geom line)
AngleInRadiansthe angle of rotation (in radians) or a name of variable which defines angle in degrees
Copyallows copying the rotated elements
MakeGroupsforces the generation of new groups from existing ones (if Copy)
Returns
list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise

References smeshBuilder.ParseAngles().

def RotateObjectMakeMesh (   self,
  theObject,
  Axis,
  AngleInRadians,
  MakeGroups = 0,
  NewMeshName = "" 
)

Create a new mesh from the rotated object.

Parameters
theObjectthe object to rotate (mesh, submesh, or group)
Axisthe axis of rotation (AxisStruct or geom line)
AngleInRadiansthe angle of rotation (in radians) or a name of variable which defines angle in degrees
MakeGroupsforces the generation of new groups from existing ones
NewMeshNamethe name of the newly created mesh
Returns
instance of Mesh class

References smeshBuilder.geompyD, Mesh.geompyD, smeshBuilder.ParseAngles(), and Mesh.smeshpyD.

def FindCoincidentNodes (   self,
  Tolerance,
  SeparateCornerAndMediumNodes = False 
)

Find groups of adjacent nodes within Tolerance.

Parameters
Tolerancethe value of tolerance
SeparateCornerAndMediumNodesif True, in quadratic mesh puts corner and medium nodes in separate groups thus preventing their further merge.
Returns
the list of groups of nodes IDs (e.g. [[1,12,13],[4,25]])

References Mesh.FindCoincidentNodesOnPart().

def FindCoincidentNodesOnPart (   self,
  SubMeshOrGroup,
  Tolerance,
  exceptNodes = [],
  SeparateCornerAndMediumNodes = False 
)

Find groups of ajacent nodes within Tolerance.

Parameters
Tolerancethe value of tolerance
SubMeshOrGroupSubMesh, Group or Filter
exceptNodeslist of either SubMeshes, Groups or node IDs to exclude from search
SeparateCornerAndMediumNodesif True, in quadratic mesh puts corner and medium nodes in separate groups thus preventing their further merge.
Returns
the list of groups of nodes IDs (e.g. [[1,12,13],[4,25]])

References Mesh.GetIDSource().

def MergeNodes (   self,
  GroupsOfNodes,
  NodesToKeep = [],
  AvoidMakingHoles = False 
)

Merge nodes.

Parameters
GroupsOfNodesa list of groups of nodes IDs for merging (e.g. [[1,12,13],[25,4]], then nodes 12, 13 and 4 will be removed and replaced by nodes 1 and 25 correspondingly in all elements and groups
NodesToKeepnodes to keep in the mesh: a list of groups, sub-meshes or node IDs. If NodesToKeep does not include a node to keep for some group to merge, then the first node in the group is kept.
AvoidMakingHolesprevent merging nodes which cause removal of elements becoming invalid
def FindEqualElements (   self,
  MeshOrSubMeshOrGroup = None 
)

Find the elements built on the same nodes.

Parameters
MeshOrSubMeshOrGroupMesh or SubMesh, or Group of elements for searching
Returns
the list of groups of equal elements IDs (e.g. [[1,12,13],[4,25]])

References Mesh.mesh.

def MergeElements (   self,
  GroupsOfElementsID 
)

Merge elements in each given group.

Parameters
GroupsOfElementsIDa list of groups of elements IDs for merging (e.g. [[1,12,13],[25,4]], then elements 12, 13 and 4 will be removed and replaced by elements 1 and 25 in all groups)
def MergeEqualElements (   self)

Leave one element and remove all other elements built on the same nodes.

def FindCoincidentFreeBorders (   self,
  tolerance = 0. 
)

Return groups of FreeBorder's coincident within the given tolerance.

Parameters
tolerancethe tolerance. If the tolerance <= 0.0 then one tenth of an average size of elements adjacent to free borders being compared is used.
Returns
SMESH.CoincidentFreeBorders structure
def SewCoincidentFreeBorders (   self,
  freeBorders,
  createPolygons = False,
  createPolyhedra = False 
)

Sew FreeBorder's of each group.

Parameters
freeBorderseither a SMESH.CoincidentFreeBorders structure or a list of lists where each enclosed list contains node IDs of a group of coincident free borders such that each consequent triple of IDs within a group describes a free border in a usual way: n1, n2, nLast - i.e. 1st node, 2nd node and last node of a border. For example [[1, 2, 10, 20, 21, 40], [11, 12, 15, 55, 54, 41]] describes two groups of coincident free borders, each group including two borders.
createPolygonsif True faces adjacent to free borders are converted to polygons if a node of opposite border falls on a face edge, else such faces are split into several ones.
createPolyhedraif True volumes adjacent to free borders are converted to polyhedra if a node of opposite border falls on a volume edge, else such volumes, if any, remain intact and the mesh becomes non-conformal.
Returns
a number of successfully sewed groups

References Mesh.SewFreeBorders().

def SewFreeBorders (   self,
  FirstNodeID1,
  SecondNodeID1,
  LastNodeID1,
  FirstNodeID2,
  SecondNodeID2,
  LastNodeID2,
  CreatePolygons,
  CreatePolyedrs 
)

Sew free borders.

Returns
SMESH::Sew_Error

References Mesh.SewConformFreeBorders().

def SewConformFreeBorders (   self,
  FirstNodeID1,
  SecondNodeID1,
  LastNodeID1,
  FirstNodeID2,
  SecondNodeID2 
)

Sew conform free borders.

Returns
SMESH::Sew_Error

References Mesh.SewBorderToSide().

def SewBorderToSide (   self,
  FirstNodeIDOnFreeBorder,
  SecondNodeIDOnFreeBorder,
  LastNodeIDOnFreeBorder,
  FirstNodeIDOnSide,
  LastNodeIDOnSide,
  CreatePolygons,
  CreatePolyedrs 
)

Sew border to side.

Returns
SMESH::Sew_Error

References Mesh.SewSideElements().

def SewSideElements (   self,
  IDsOfSide1Elements,
  IDsOfSide2Elements,
  NodeID1OfSide1ToMerge,
  NodeID1OfSide2ToMerge,
  NodeID2OfSide1ToMerge,
  NodeID2OfSide2ToMerge 
)

Sew two sides of a mesh.

The nodes belonging to Side1 are merged with the nodes of elements of Side2. The number of elements in theSide1 and in theSide2 must be equal and they should have similar nodal connectivity. The nodes to merge should belong to side borders and the first node should be linked to the second.

Returns
SMESH::Sew_Error