Back to index

salome-smesh  6.5.0
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 
)

Finds groups of ajacent nodes within Tolerance.

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

Definition at line 3675 of file smeshDC.py.

03675 
03676     def FindCoincidentNodes (self, Tolerance):
03677         return self.editor.FindCoincidentNodes(Tolerance)

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

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 3684 of file smeshDC.py.

03684 
03685     def FindCoincidentNodesOnPart (self, SubMeshOrGroup, Tolerance, exceptNodes=[]):
03686         if (isinstance( SubMeshOrGroup, Mesh )):
03687             SubMeshOrGroup = SubMeshOrGroup.GetMesh()
03688         if not isinstance( exceptNodes, list):
03689             exceptNodes = [ exceptNodes ]
03690         if exceptNodes and isinstance( exceptNodes[0], int):
03691             exceptNodes = [ self.GetIDSource( exceptNodes, SMESH.NODE)]
03692         return self.editor.FindCoincidentNodesOnPartBut(SubMeshOrGroup, Tolerance,exceptNodes)

Here is the call graph for this function:

def smeshDC.Mesh.FindEqualElements (   self,
  MeshOrSubMeshOrGroup 
)

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 3703 of file smeshDC.py.

03703 
03704     def FindEqualElements (self, MeshOrSubMeshOrGroup):
03705         if ( isinstance( MeshOrSubMeshOrGroup, Mesh )):
03706             MeshOrSubMeshOrGroup = MeshOrSubMeshOrGroup.GetMesh()
03707         return self.editor.FindEqualElements(MeshOrSubMeshOrGroup)

def smeshDC.Mesh.MergeElements (   self,
  GroupsOfElementsID 
)

Merges elements in each given group.

Parameters:
GroupsOfElementsIDgroups of elements for merging

Definition at line 3711 of file smeshDC.py.

03711 
03712     def MergeElements(self, GroupsOfElementsID):
03713         self.editor.MergeElements(GroupsOfElementsID)

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

Definition at line 3716 of file smeshDC.py.

03716 
03717     def MergeEqualElements(self):
03718         self.editor.MergeEqualElements()

Here is the call graph for this function:

def smeshDC.Mesh.MergeNodes (   self,
  GroupsOfNodes 
)

Merges nodes.

Parameters:
GroupsOfNodesthe list of groups of nodes

Definition at line 3696 of file smeshDC.py.

03696 
03697     def MergeNodes (self, GroupsOfNodes):
03698         self.editor.MergeNodes(GroupsOfNodes)

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

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 3408 of file smeshDC.py.

03408 
03409     def Mirror(self, IDsOfElements, Mirror, theMirrorType, Copy=0, MakeGroups=False):
03410         if IDsOfElements == []:
03411             IDsOfElements = self.GetElementsId()
03412         if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
03413             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
03414         self.mesh.SetParameters(Mirror.parameters)
03415         if Copy and MakeGroups:
03416             return self.editor.MirrorMakeGroups(IDsOfElements, Mirror, theMirrorType)
03417         self.editor.Mirror(IDsOfElements, Mirror, theMirrorType, Copy)
03418         return []

Here is the call graph for this function:

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

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 3428 of file smeshDC.py.

03428 
03429     def MirrorMakeMesh(self, IDsOfElements, Mirror, theMirrorType, MakeGroups=0, NewMeshName=""):
03430         if IDsOfElements == []:
03431             IDsOfElements = self.GetElementsId()
03432         if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
03433             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
03434         self.mesh.SetParameters(Mirror.parameters)
03435         mesh = self.editor.MirrorMakeMesh(IDsOfElements, Mirror, theMirrorType,
03436                                           MakeGroups, NewMeshName)
03437         return Mesh(self.smeshpyD,self.geompyD,mesh)

Here is the call graph for this function:

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

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 3447 of file smeshDC.py.

03447 
03448     def MirrorObject (self, theObject, Mirror, theMirrorType, Copy=0, MakeGroups=False):
03449         if ( isinstance( theObject, Mesh )):
03450             theObject = theObject.GetMesh()
03451         if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
03452             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
03453         self.mesh.SetParameters(Mirror.parameters)
03454         if Copy and MakeGroups:
03455             return self.editor.MirrorObjectMakeGroups(theObject, Mirror, theMirrorType)
03456         self.editor.MirrorObject(theObject, Mirror, theMirrorType, Copy)
03457         return []

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

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 3467 of file smeshDC.py.

03467 
03468     def MirrorObjectMakeMesh (self, theObject, Mirror, theMirrorType,MakeGroups=0, NewMeshName=""):
03469         if ( isinstance( theObject, Mesh )):
03470             theObject = theObject.GetMesh()
03471         if (isinstance(Mirror, geompyDC.GEOM._objref_GEOM_Object)):
03472             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
03473         self.mesh.SetParameters(Mirror.parameters)
03474         mesh = self.editor.MirrorObjectMakeMesh(theObject, Mirror, theMirrorType,
03475                                                 MakeGroups, NewMeshName)
03476         return Mesh( self.smeshpyD,self.geompyD,mesh )

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

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 3597 of file smeshDC.py.

03597 
03598     def Rotate (self, IDsOfElements, Axis, AngleInRadians, Copy, MakeGroups=False):
03599         if IDsOfElements == []:
03600             IDsOfElements = self.GetElementsId()
03601         if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
03602             Axis = self.smeshpyD.GetAxisStruct(Axis)
03603         AngleInRadians,Parameters,hasVars = ParseAngles(AngleInRadians)
03604         Parameters = Axis.parameters + var_separator + Parameters
03605         self.mesh.SetParameters(Parameters)
03606         if Copy and MakeGroups:
03607             return self.editor.RotateMakeGroups(IDsOfElements, Axis, AngleInRadians)
03608         self.editor.Rotate(IDsOfElements, Axis, AngleInRadians, Copy)
03609         return []

Here is the call graph for this function:

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

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 3618 of file smeshDC.py.

03618 
03619     def RotateMakeMesh (self, IDsOfElements, Axis, AngleInRadians, MakeGroups=0, NewMeshName=""):
03620         if IDsOfElements == []:
03621             IDsOfElements = self.GetElementsId()
03622         if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
03623             Axis = self.smeshpyD.GetAxisStruct(Axis)
03624         AngleInRadians,Parameters,hasVars = ParseAngles(AngleInRadians)
03625         Parameters = Axis.parameters + var_separator + Parameters
03626         self.mesh.SetParameters(Parameters)
03627         mesh = self.editor.RotateMakeMesh(IDsOfElements, Axis, AngleInRadians,
03628                                           MakeGroups, NewMeshName)
03629         return Mesh( self.smeshpyD, self.geompyD, mesh )

Here is the call graph for this function:

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

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 3638 of file smeshDC.py.

03638 
03639     def RotateObject (self, theObject, Axis, AngleInRadians, Copy, MakeGroups=False):
03640         if (isinstance(theObject, Mesh)):
03641             theObject = theObject.GetMesh()
03642         if (isinstance(Axis, geompyDC.GEOM._objref_GEOM_Object)):
03643             Axis = self.smeshpyD.GetAxisStruct(Axis)
03644         AngleInRadians,Parameters,hasVars = ParseAngles(AngleInRadians)
03645         Parameters = Axis.parameters + ":" + Parameters
03646         self.mesh.SetParameters(Parameters)
03647         if Copy and MakeGroups:
03648             return self.editor.RotateObjectMakeGroups(theObject, Axis, AngleInRadians)
03649         self.editor.RotateObject(theObject, Axis, AngleInRadians, Copy)
03650         return []

Here is the call graph for this function:

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

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 3659 of file smeshDC.py.

03659 
03660     def RotateObjectMakeMesh(self, theObject, Axis, AngleInRadians, MakeGroups=0,NewMeshName=""):
03661         if (isinstance( theObject, Mesh )):
03662             theObject = theObject.GetMesh()
03663         if (isinstance(Axis, geompyDC.GEOM._objref_GEOM_Object)):
03664             Axis = self.smeshpyD.GetAxisStruct(Axis)
03665         AngleInRadians,Parameters,hasVars = ParseAngles(AngleInRadians)
03666         Parameters = Axis.parameters + ":" + Parameters
03667         mesh = self.editor.RotateObjectMakeMesh(theObject, Axis, AngleInRadians,
03668                                                        MakeGroups, NewMeshName)
03669         self.mesh.SetParameters(Parameters)
03670         return Mesh( self.smeshpyD, self.geompyD, mesh )

Here is the call graph for this function:

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

Sews border to side.

Returns:
SMESH::Sew_Error

Definition at line 3741 of file smeshDC.py.

03741 
03742                          FirstNodeIDOnSide, LastNodeIDOnSide, CreatePolygons, CreatePolyedrs):
03743         return self.editor.SewBorderToSide(FirstNodeIDOnFreeBorder, SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder,
03744                                            FirstNodeIDOnSide, LastNodeIDOnSide, CreatePolygons, CreatePolyedrs)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Sews conform free borders.

Returns:
SMESH::Sew_Error

Definition at line 3733 of file smeshDC.py.

03733 
03734                                FirstNodeID2, SecondNodeID2):
03735         return self.editor.SewConformFreeBorders(FirstNodeID1, SecondNodeID1, LastNodeID1,
03736                                                  FirstNodeID2, SecondNodeID2)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Sews free borders.

Returns:
SMESH::Sew_Error

Definition at line 3724 of file smeshDC.py.

03724 
03725                         CreatePolygons, CreatePolyedrs):
03726         return self.editor.SewFreeBorders(FirstNodeID1, SecondNodeID1, LastNodeID1,
03727                                           FirstNodeID2, SecondNodeID2, LastNodeID2,
03728                                           CreatePolygons, CreatePolyedrs)

Here is the call graph for this function:

Here is the caller graph for this function:

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

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 3755 of file smeshDC.py.

03755 
03756                          NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge):
03757         return self.editor.SewSideElements(IDsOfSide1Elements, IDsOfSide2Elements,
03758                                            NodeID1OfSide1ToMerge, NodeID1OfSide2ToMerge,
03759                                            NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge)

Here is the caller graph for this function:

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

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 3484 of file smeshDC.py.

03484 
03485     def Translate(self, IDsOfElements, Vector, Copy, MakeGroups=False):
03486         if IDsOfElements == []:
03487             IDsOfElements = self.GetElementsId()
03488         if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
03489             Vector = self.smeshpyD.GetDirStruct(Vector)
03490         self.mesh.SetParameters(Vector.PS.parameters)
03491         if Copy and MakeGroups:
03492             return self.editor.TranslateMakeGroups(IDsOfElements, Vector)
03493         self.editor.Translate(IDsOfElements, Vector, Copy)
03494         return []

Here is the call graph for this function:

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

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 3502 of file smeshDC.py.

03502 
03503     def TranslateMakeMesh(self, IDsOfElements, Vector, MakeGroups=False, NewMeshName=""):
03504         if IDsOfElements == []:
03505             IDsOfElements = self.GetElementsId()
03506         if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
03507             Vector = self.smeshpyD.GetDirStruct(Vector)
03508         self.mesh.SetParameters(Vector.PS.parameters)
03509         mesh = self.editor.TranslateMakeMesh(IDsOfElements, Vector, MakeGroups, NewMeshName)
03510         return Mesh ( self.smeshpyD, self.geompyD, mesh )

Here is the call graph for this function:

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

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 3518 of file smeshDC.py.

03518 
03519     def TranslateObject(self, theObject, Vector, Copy, MakeGroups=False):
03520         if ( isinstance( theObject, Mesh )):
03521             theObject = theObject.GetMesh()
03522         if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
03523             Vector = self.smeshpyD.GetDirStruct(Vector)
03524         self.mesh.SetParameters(Vector.PS.parameters)
03525         if Copy and MakeGroups:
03526             return self.editor.TranslateObjectMakeGroups(theObject, Vector)
03527         self.editor.TranslateObject(theObject, Vector, Copy)
03528         return []

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

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 3536 of file smeshDC.py.

03536 
03537     def TranslateObjectMakeMesh(self, theObject, Vector, MakeGroups=False, NewMeshName=""):
03538         if (isinstance(theObject, Mesh)):
03539             theObject = theObject.GetMesh()
03540         if (isinstance(Vector, geompyDC.GEOM._objref_GEOM_Object)):
03541             Vector = self.smeshpyD.GetDirStruct(Vector)
03542         self.mesh.SetParameters(Vector.PS.parameters)
03543         mesh = self.editor.TranslateObjectMakeMesh(theObject, Vector, MakeGroups, NewMeshName)
03544         return Mesh( self.smeshpyD, self.geompyD, mesh )
03545 
03546