Version: 6.3.1
Functions

Transforming meshes (Translation, Rotation, Symmetry, Sewing, Merging)

Modifying meshes
Collaboration diagram for Transforming meshes (Translation, Rotation, Symmetry, Sewing, Merging):

Functions

def smeshDC::Mesh.Mirror
 Creates a symmetrical copy of mesh elements.
def smeshDC::Mesh.MirrorMakeMesh
 Creates a new mesh by a symmetrical copy of mesh elements.
def smeshDC::Mesh.MirrorObject
 Creates a symmetrical copy of the object.
def smeshDC::Mesh.MirrorObjectMakeMesh
 Creates a new mesh by a symmetrical copy of the object.
def smeshDC::Mesh.Translate
 Translates the elements.
def smeshDC::Mesh.TranslateMakeMesh
 Creates a new mesh of translated elements.
def smeshDC::Mesh.TranslateObject
 Translates the object.
def smeshDC::Mesh.TranslateObjectMakeMesh
 Creates a new mesh from the translated object.
def smeshDC::Mesh.Rotate
 Rotates the elements.
def smeshDC::Mesh.RotateMakeMesh
 Creates a new mesh of rotated elements.
def smeshDC::Mesh.RotateObject
 Rotates the object.
def smeshDC::Mesh.RotateObjectMakeMesh
 Creates a new mesh from the rotated object.
def smeshDC::Mesh.FindCoincidentNodes
 Finds groups of ajacent nodes within Tolerance.
def smeshDC::Mesh.FindCoincidentNodesOnPart
 Finds groups of ajacent nodes within Tolerance.
def smeshDC::Mesh.MergeNodes
 Merges nodes.
def smeshDC::Mesh.FindEqualElements
 Finds the elements built on the same nodes.
def smeshDC::Mesh.MergeElements
 Merges elements in each given group.
def smeshDC::Mesh.MergeEqualElements
 Leaves one element and removes all other elements built on the same nodes.
def smeshDC::Mesh.SewFreeBorders
 Sews free borders.
def smeshDC::Mesh.SewConformFreeBorders
 Sews conform free borders.
def smeshDC::Mesh.SewBorderToSide
 Sews border to side.
def smeshDC::Mesh.SewSideElements
 Sews two sides of a mesh.

Function Documentation

def smeshDC.Mesh.FindCoincidentNodes (   self,
  Tolerance 
) [inherited]

Finds groups of ajacent nodes within Tolerance.

Parameters:
Tolerancethe value of tolerance
Returns:
the list of groups of nodes

Definition at line 3937 of file smeshDC.py.

03938                                              :
03939         return self.editor.FindCoincidentNodes(Tolerance)

def smeshDC.Mesh.FindCoincidentNodesOnPart (   self,
  SubMeshOrGroup,
  Tolerance,
  exceptNodes = [] 
) [inherited]

Finds groups of ajacent nodes within Tolerance.

Parameters:
Tolerancethe value of tolerance
SubMeshOrGroupSubMesh or Group
exceptNodeslist of either SubMeshes, Groups or node IDs to exclude from search
Returns:
the list of groups of nodes

Definition at line 3946 of file smeshDC.py.

03947                                                                                    :
03948         if (isinstance( SubMeshOrGroup, Mesh )):
03949             SubMeshOrGroup = SubMeshOrGroup.GetMesh()
03950         if not isinstance( exceptNodes, list):
03951             exceptNodes = [ exceptNodes ]
03952         if exceptNodes and isinstance( exceptNodes[0], int):
03953             exceptNodes = [ self.GetIDSource( exceptNodes, SMESH.NODE)]
03954         return self.editor.FindCoincidentNodesOnPartBut(SubMeshOrGroup, Tolerance,exceptNodes)

def smeshDC.Mesh.FindEqualElements (   self,
  MeshOrSubMeshOrGroup 
) [inherited]

Finds the elements built on the same nodes.

Parameters:
MeshOrSubMeshOrGroupMesh or SubMesh, or Group of elements for searching
Returns:
a list of groups of equal elements

Definition at line 3965 of file smeshDC.py.

03966                                                       :
03967         if ( isinstance( MeshOrSubMeshOrGroup, Mesh )):
03968             MeshOrSubMeshOrGroup = MeshOrSubMeshOrGroup.GetMesh()
03969         return self.editor.FindEqualElements(MeshOrSubMeshOrGroup)

def smeshDC.Mesh.MergeElements (   self,
  GroupsOfElementsID 
) [inherited]

Merges elements in each given group.

Parameters:
GroupsOfElementsIDgroups of elements for merging

Definition at line 3973 of file smeshDC.py.

03974                                                :
03975         self.editor.MergeElements(GroupsOfElementsID)

def smeshDC.Mesh.MergeEqualElements (   self) [inherited]

Leaves one element and removes all other elements built on the same nodes.

Definition at line 3978 of file smeshDC.py.

03979                                 :
03980         self.editor.MergeEqualElements()

def smeshDC.Mesh.MergeNodes (   self,
  GroupsOfNodes 
) [inherited]

Merges nodes.

Parameters:
GroupsOfNodesthe list of groups of nodes

Definition at line 3958 of file smeshDC.py.

03959                                         :
03960         self.editor.MergeNodes(GroupsOfNodes)

def smeshDC.Mesh.Mirror (   self,
  IDsOfElements,
  Mirror,
  theMirrorType,
  Copy = 0,
  MakeGroups = False 
) [inherited]

Creates a symmetrical copy of mesh elements.

Parameters:
IDsOfElementslist of elements ids
Mirroris AxisStruct or geom object(point, line, plane)
theMirrorTypeis POINT, AXIS or 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

Definition at line 3637 of file smeshDC.py.

03638                                                                                     :
03639         if IDsOfElements == []:
03640             IDsOfElements = self.GetElementsId()
03641         if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
03642             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
03643         Mirror,Parameters = ParseAxisStruct(Mirror)
03644         self.mesh.SetParameters(Parameters)
03645         if Copy and MakeGroups:
03646             return self.editor.MirrorMakeGroups(IDsOfElements, Mirror, theMirrorType)
03647         self.editor.Mirror(IDsOfElements, Mirror, theMirrorType, Copy)
03648         return []

def smeshDC.Mesh.MirrorMakeMesh (   self,
  IDsOfElements,
  Mirror,
  theMirrorType,
  MakeGroups = 0,
  NewMeshName = "" 
) [inherited]

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

Parameters:
IDsOfElementsthe list of elements ids
Mirroris AxisStruct or geom object (point, line, plane)
theMirrorTypeis POINT, AXIS or 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

Definition at line 3658 of file smeshDC.py.

03659                                                                                                 :
03660         if IDsOfElements == []:
03661             IDsOfElements = self.GetElementsId()
03662         if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
03663             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
03664         Mirror,Parameters = ParseAxisStruct(Mirror)
03665         mesh = self.editor.MirrorMakeMesh(IDsOfElements, Mirror, theMirrorType,
03666                                           MakeGroups, NewMeshName)
03667         mesh.SetParameters(Parameters)
03668         return Mesh(self.smeshpyD,self.geompyD,mesh)

def smeshDC.Mesh.MirrorObject (   self,
  theObject,
  Mirror,
  theMirrorType,
  Copy = 0,
  MakeGroups = False 
) [inherited]

Creates a symmetrical copy of the object.

Parameters:
theObjectmesh, submesh or group
MirrorAxisStruct or geom object (point, line, plane)
theMirrorTypeis POINT, AXIS or 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

Definition at line 3678 of file smeshDC.py.

03679                                                                                        :
03680         if ( isinstance( theObject, Mesh )):
03681             theObject = theObject.GetMesh()
03682         if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
03683             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
03684         Mirror,Parameters = ParseAxisStruct(Mirror)
03685         self.mesh.SetParameters(Parameters)
03686         if Copy and MakeGroups:
03687             return self.editor.MirrorObjectMakeGroups(theObject, Mirror, theMirrorType)
03688         self.editor.MirrorObject(theObject, Mirror, theMirrorType, Copy)
03689         return []

def smeshDC.Mesh.MirrorObjectMakeMesh (   self,
  theObject,
  Mirror,
  theMirrorType,
  MakeGroups = 0,
  NewMeshName = "" 
) [inherited]

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

Parameters:
theObjectmesh, submesh or group
MirrorAxisStruct or geom object (point, line, plane)
theMirrorTypePOINT, AXIS or 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

Definition at line 3699 of file smeshDC.py.

03700                                                                                                   :
03701         if ( isinstance( theObject, Mesh )):
03702             theObject = theObject.GetMesh()
03703         if (isinstance(Mirror, geompyDC.GEOM._objref_GEOM_Object)):
03704             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
03705         Mirror,Parameters = ParseAxisStruct(Mirror)
03706         mesh = self.editor.MirrorObjectMakeMesh(theObject, Mirror, theMirrorType,
03707                                                 MakeGroups, NewMeshName)
03708         mesh.SetParameters(Parameters)
03709         return Mesh( self.smeshpyD,self.geompyD,mesh )

def smeshDC.Mesh.Rotate (   self,
  IDsOfElements,
  Axis,
  AngleInRadians,
  Copy,
  MakeGroups = False 
) [inherited]

Rotates 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

Definition at line 3835 of file smeshDC.py.

03836                                                                                   :
03837         flag = False
03838         if isinstance(AngleInRadians,str):
03839             flag = True
03840         AngleInRadians,Parameters = geompyDC.ParseParameters(AngleInRadians)
03841         if flag:
03842             AngleInRadians = DegreesToRadians(AngleInRadians)
03843         if IDsOfElements == []:
03844             IDsOfElements = self.GetElementsId()
03845         if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
03846             Axis = self.smeshpyD.GetAxisStruct(Axis)
03847         Axis,AxisParameters = ParseAxisStruct(Axis)
03848         Parameters = AxisParameters + var_separator + Parameters
03849         self.mesh.SetParameters(Parameters)
03850         if Copy and MakeGroups:
03851             return self.editor.RotateMakeGroups(IDsOfElements, Axis, AngleInRadians)
03852         self.editor.Rotate(IDsOfElements, Axis, AngleInRadians, Copy)
03853         return []

def smeshDC.Mesh.RotateMakeMesh (   self,
  IDsOfElements,
  Axis,
  AngleInRadians,
  MakeGroups = 0,
  NewMeshName = "" 
) [inherited]

Creates 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

Definition at line 3862 of file smeshDC.py.

03863                                                                                                 :
03864         flag = False
03865         if isinstance(AngleInRadians,str):
03866             flag = True
03867         AngleInRadians,Parameters = geompyDC.ParseParameters(AngleInRadians)
03868         if flag:
03869             AngleInRadians = DegreesToRadians(AngleInRadians)
03870         if IDsOfElements == []:
03871             IDsOfElements = self.GetElementsId()
03872         if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
03873             Axis = self.smeshpyD.GetAxisStruct(Axis)
03874         Axis,AxisParameters = ParseAxisStruct(Axis)
03875         Parameters = AxisParameters + var_separator + Parameters
03876         mesh = self.editor.RotateMakeMesh(IDsOfElements, Axis, AngleInRadians,
03877                                           MakeGroups, NewMeshName)
03878         mesh.SetParameters(Parameters)
03879         return Mesh( self.smeshpyD, self.geompyD, mesh )

def smeshDC.Mesh.RotateObject (   self,
  theObject,
  Axis,
  AngleInRadians,
  Copy,
  MakeGroups = False 
) [inherited]

Rotates 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

Definition at line 3888 of file smeshDC.py.

03889                                                                                     :
03890         flag = False
03891         if isinstance(AngleInRadians,str):
03892             flag = True
03893         AngleInRadians,Parameters = geompyDC.ParseParameters(AngleInRadians)
03894         if flag:
03895             AngleInRadians = DegreesToRadians(AngleInRadians)
03896         if (isinstance(theObject, Mesh)):
03897             theObject = theObject.GetMesh()
03898         if (isinstance(Axis, geompyDC.GEOM._objref_GEOM_Object)):
03899             Axis = self.smeshpyD.GetAxisStruct(Axis)
03900         Axis,AxisParameters = ParseAxisStruct(Axis)
03901         Parameters = AxisParameters + ":" + Parameters
03902         self.mesh.SetParameters(Parameters)
03903         if Copy and MakeGroups:
03904             return self.editor.RotateObjectMakeGroups(theObject, Axis, AngleInRadians)
03905         self.editor.RotateObject(theObject, Axis, AngleInRadians, Copy)
03906         return []

def smeshDC.Mesh.RotateObjectMakeMesh (   self,
  theObject,
  Axis,
  AngleInRadians,
  MakeGroups = 0,
  NewMeshName = "" 
) [inherited]

Creates 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

Definition at line 3915 of file smeshDC.py.

03916                                                                                                 :
03917         flag = False
03918         if isinstance(AngleInRadians,str):
03919             flag = True
03920         AngleInRadians,Parameters = geompyDC.ParseParameters(AngleInRadians)
03921         if flag:
03922             AngleInRadians = DegreesToRadians(AngleInRadians)
03923         if (isinstance( theObject, Mesh )):
03924             theObject = theObject.GetMesh()
03925         if (isinstance(Axis, geompyDC.GEOM._objref_GEOM_Object)):
03926             Axis = self.smeshpyD.GetAxisStruct(Axis)
03927         Axis,AxisParameters = ParseAxisStruct(Axis)
03928         Parameters = AxisParameters + ":" + Parameters
03929         mesh = self.editor.RotateObjectMakeMesh(theObject, Axis, AngleInRadians,
03930                                                        MakeGroups, NewMeshName)
03931         mesh.SetParameters(Parameters)
03932         return Mesh( self.smeshpyD, self.geompyD, mesh )

def smeshDC.Mesh.SewBorderToSide (   self,
  FirstNodeIDOnFreeBorder,
  SecondNodeIDOnFreeBorder,
  LastNodeIDOnFreeBorder,
  FirstNodeIDOnSide,
  LastNodeIDOnSide,
  CreatePolygons,
  CreatePolyedrs 
) [inherited]

Sews border to side.

Returns:
SMESH.Sew_Error

Definition at line 4002 of file smeshDC.py.

04004                                                                                              :
04005         return self.editor.SewBorderToSide(FirstNodeIDOnFreeBorder, SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder,
04006                                            FirstNodeIDOnSide, LastNodeIDOnSide, CreatePolygons, CreatePolyedrs)

def smeshDC.Mesh.SewConformFreeBorders (   self,
  FirstNodeID1,
  SecondNodeID1,
  LastNodeID1,
  FirstNodeID2,
  SecondNodeID2 
) [inherited]

Sews conform free borders.

Returns:
SMESH.Sew_Error

Definition at line 3994 of file smeshDC.py.

03996                                                            :
03997         return self.editor.SewConformFreeBorders(FirstNodeID1, SecondNodeID1, LastNodeID1,
03998                                                  FirstNodeID2, SecondNodeID2)

def smeshDC.Mesh.SewFreeBorders (   self,
  FirstNodeID1,
  SecondNodeID1,
  LastNodeID1,
  FirstNodeID2,
  SecondNodeID2,
  LastNodeID2,
  CreatePolygons,
  CreatePolyedrs 
) [inherited]

Sews free borders.

Returns:
SMESH.Sew_Error

Definition at line 3984 of file smeshDC.py.

03987                                                        :
03988         return self.editor.SewFreeBorders(FirstNodeID1, SecondNodeID1, LastNodeID1,
03989                                           FirstNodeID2, SecondNodeID2, LastNodeID2,
03990                                           CreatePolygons, CreatePolyedrs)

def smeshDC.Mesh.SewSideElements (   self,
  IDsOfSide1Elements,
  IDsOfSide2Elements,
  NodeID1OfSide1ToMerge,
  NodeID1OfSide2ToMerge,
  NodeID2OfSide1ToMerge,
  NodeID2OfSide2ToMerge 
) [inherited]

Sews 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

Definition at line 4015 of file smeshDC.py.

04018                                                                       :
04019         return self.editor.SewSideElements(IDsOfSide1Elements, IDsOfSide2Elements,
04020                                            NodeID1OfSide1ToMerge, NodeID1OfSide2ToMerge,
04021                                            NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge)

def smeshDC.Mesh.Translate (   self,
  IDsOfElements,
  Vector,
  Copy,
  MakeGroups = False 
) [inherited]

Translates the elements.

Parameters:
IDsOfElementslist of elements ids
Vectorthe direction of translation (DirStruct or vector)
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

Definition at line 3717 of file smeshDC.py.

03718                                                                       :
03719         if IDsOfElements == []:
03720             IDsOfElements = self.GetElementsId()
03721         if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
03722             Vector = self.smeshpyD.GetDirStruct(Vector)
03723         Vector,Parameters = ParseDirStruct(Vector)
03724         self.mesh.SetParameters(Parameters)
03725         if Copy and MakeGroups:
03726             return self.editor.TranslateMakeGroups(IDsOfElements, Vector)
03727         self.editor.Translate(IDsOfElements, Vector, Copy)
03728         return []

def smeshDC.Mesh.TranslateMakeMesh (   self,
  IDsOfElements,
  Vector,
  MakeGroups = False,
  NewMeshName = "" 
) [inherited]

Creates a new mesh of translated elements.

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

Definition at line 3736 of file smeshDC.py.

03737                                                                                         :
03738         if IDsOfElements == []:
03739             IDsOfElements = self.GetElementsId()
03740         if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
03741             Vector = self.smeshpyD.GetDirStruct(Vector)
03742         Vector,Parameters = ParseDirStruct(Vector)
03743         mesh = self.editor.TranslateMakeMesh(IDsOfElements, Vector, MakeGroups, NewMeshName)
03744         mesh.SetParameters(Parameters)
03745         return Mesh ( self.smeshpyD, self.geompyD, mesh )

def smeshDC.Mesh.TranslateObject (   self,
  theObject,
  Vector,
  Copy,
  MakeGroups = False 
) [inherited]

Translates the object.

Parameters:
theObjectthe object to translate (mesh, submesh, or group)
Vectordirection of translation (DirStruct or geom vector)
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

Definition at line 3753 of file smeshDC.py.

03754                                                                         :
03755         if ( isinstance( theObject, Mesh )):
03756             theObject = theObject.GetMesh()
03757         if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
03758             Vector = self.smeshpyD.GetDirStruct(Vector)
03759         Vector,Parameters = ParseDirStruct(Vector)
03760         self.mesh.SetParameters(Parameters)
03761         if Copy and MakeGroups:
03762             return self.editor.TranslateObjectMakeGroups(theObject, Vector)
03763         self.editor.TranslateObject(theObject, Vector, Copy)
03764         return []

def smeshDC.Mesh.TranslateObjectMakeMesh (   self,
  theObject,
  Vector,
  MakeGroups = False,
  NewMeshName = "" 
) [inherited]

Creates a new mesh from the translated object.

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

Definition at line 3772 of file smeshDC.py.

03773                                                                                           :
03774         if (isinstance(theObject, Mesh)):
03775             theObject = theObject.GetMesh()
03776         if (isinstance(Vector, geompyDC.GEOM._objref_GEOM_Object)):
03777             Vector = self.smeshpyD.GetDirStruct(Vector)
03778         Vector,Parameters = ParseDirStruct(Vector)
03779         mesh = self.editor.TranslateObjectMakeMesh(theObject, Vector, MakeGroups, NewMeshName)
03780         mesh.SetParameters(Parameters)
03781         return Mesh( self.smeshpyD, self.geompyD, mesh )
03782 
03783 

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS