# smesh.Mesh Class Reference

Class to define a mesh. More...

## Public Member Functions
def | __init__
| Constructor.
def | SetMesh
| Method that inits the Mesh object from SMESH_Mesh interface.
def | GetMesh
| Method that returns the mesh.
def | GetName
| Get mesh name.
def | SetName
| Set name to mesh.
def | GetSubMesh
| Get the subMesh object associated to a subShape.
def | GetShape
| Method that returns the shape associated to the mesh.
def | SetShape
| Method that associates given shape to the mesh(entails the mesh recreation).
def | IsReadyToCompute
| Return true if hypotheses are defined well.
def | GetAlgoState
| Return errors of hypotheses definintion error list is empty if everything is OK.
def | GetGeometryByMeshElement
| Return geometrical object the given element is built on.
def | MeshDimension
| Returns mesh dimension depending on shape one.
def | Segment
| Creates a segment discretization 1D algorithm.
def | Triangle
| Creates a triangle 2D algorithm for faces.
def | Quadrangle
| Creates a quadrangle 2D algorithm for faces.
def | Tetrahedron
| Creates a tetrahedron 3D algorithm for solids.
def | Hexahedron
| Creates a hexahedron 3D algorithm for solids.
def | Netgen
| Deprecated, only for compatibility!
def | Compute
| Compute the mesh and return the status of the computation.
def | AutomaticTetrahedralization
| Compute tetrahedral mesh using AutomaticLength + MEFISTO + NETGEN The parameter fineness [0,-1] defines mesh fineness.
def | AutomaticHexahedralization
| Compute hexahedral mesh using AutomaticLength + Quadrangle + Hexahedron The parameter fineness [0,-1] defines mesh fineness.
def | GetHypothesisList
| Get the list of hypothesis added on a geom.
def | RemoveGlobalHypotheses
| Removes all global hypotheses.
def | Group
| Create a mesh group based on geometric object grp and give a name, if this parameter is not defined the name is the same as the geometric group name Note: Works like GroupOnGeom().
def | ExportToMED
| Deprecated, only for compatibility! Please, use ExportMED() method instead.
def | ExportMED
| Export the mesh in a file with the MED format.
def | ExportDAT
| Export the mesh in a file with the DAT format.
def | ExportUNV
| Export the mesh in a file with the UNV format.
def | ExportSTL
| Export the mesh in a file with the STL format.
def | CreateEmptyGroup
| Creates an empty mesh group.
def | GroupOnGeom
| Creates a mesh group based on geometric object grp and give a name, if this parameter is not defined the name is the same as the geometric group name.
def | MakeGroupByIds
| Create a mesh group by the given ids of elements.
def | MakeGroup
| Create a mesh group by the given conditions.
def | MakeGroupByCriterion
| Create a mesh group by the given criterion.
def | MakeGroupByCriteria
| Create a mesh group by the given criteria(list of criterions).
def | MakeGroupByFilter
| Create a mesh group by the given filter.
def | GetIdsFromFilter
| Pass mesh elements through the given filter and return ids.
def | GetFreeBorders
| Verify whether 2D mesh element has free edges(edges connected to one face only) Returns list of special structures(borders).
def | RemoveGroup
| Remove a group.
def | RemoveGroupWithContents
| Remove group with its contents.
def | GetGroups
| Get the list of groups existing in the mesh.
def | GetGroupNames
| Get the list of names of groups existing in the mesh.
def | UnionGroups
| Union of two groups New group is created.
def | IntersectGroups
| Intersection of two groups New group is created.
def | CutGroups
| Cut of two groups New group is created.
def | GetLog
| Get the log of nodes and elements added or removed since previous clear of the log.
def | ClearLog
| Clear the log of nodes and elements added or removed since previous clear.
def | GetId
| Get the internal Id.
def | GetStudyId
| Get the study Id.
def | HasDuplicatedGroupNamesMED
| Check group names for duplications.
def | GetMeshEditor
| Obtain instance of SMESH_MeshEditor.
def | GetMEDMesh
| Get MED Mesh.
def | NbNodes
| Returns number of nodes in mesh.
def | NbElements
| Returns number of elements in mesh.
def | NbEdges
| Returns number of edges in mesh.
def | NbEdgesOfOrder
| Returns number of edges with given order in mesh.
def | NbFaces
| Returns number of faces in mesh.
def | NbFacesOfOrder
| Returns number of faces with given order in mesh.
def | NbTriangles
| Returns number of triangles in mesh.
def | NbTrianglesOfOrder
| Returns number of triangles with given order in mesh.
def | NbQuadrangles
| Returns number of quadrangles in mesh.
def | NbQuadranglesOfOrder
| Returns number of quadrangles with given order in mesh.
def | NbPolygons
| Returns number of polygons in mesh.
def | NbVolumes
| Returns number of volumes in mesh.
def | NbVolumesOfOrder
| Returns number of volumes with given order in mesh.
def | NbTetras
| Returns number of tetrahedrons in mesh.
def | NbTetrasOfOrder
| Returns number of tetrahedrons with given order in mesh.
def | NbHexas
| Returns number of hexahedrons in mesh.
def | NbHexasOfOrder
| Returns number of hexahedrons with given order in mesh.
def | NbPyramids
| Returns number of pyramids in mesh.
def | NbPyramidsOfOrder
| Returns number of pyramids with given order in mesh.
def | NbPrisms
| Returns number of prisms in mesh.
def | NbPrismsOfOrder
| Returns number of prisms with given order in mesh.
def | NbPolyhedrons
| Returns number of polyhedrons in mesh.
def | NbSubMesh
| Returns number of submeshes in mesh.
def | GetElementsId
| Returns list of mesh elements ids.
def | GetElementsByType
| Returns list of ids of mesh elements with given type.
def | GetNodesId
| Returns list of mesh nodes ids.
def | GetElementType
| Returns type of mesh element.
def | GetSubMeshElementsId
| Returns list of submesh elements ids.
def | GetSubMeshNodesId
| Returns list of submesh nodes ids.
def | GetSubMeshElementType
| Returns list of ids of submesh elements with given type.
def | Dump
| Get mesh description.
def | GetNodeXYZ
| Get XYZ coordinates of node as list of double If there is not node for given ID - returns empty list.
def | GetNodeInverseElements
| For given node returns list of IDs of inverse elements If there is not node for given ID - returns empty list.
def | GetShapeID
| If given element is node returns IDs of shape from position If there is not node for given ID - returns -1.
def | GetShapeIDForElem
| For given element returns ID of result shape after FindShape() from SMESH_MeshEditor If there is not element for given ID - returns -1.
def | GetElemNbNodes
| Returns number of nodes for given element If there is not element for given ID - returns -1.
def | GetElemNode
| Returns ID of node by given index for given element If there is not element for given ID - returns -1 If there is not node for given index - returns -2.
def | IsMediumNode
| Returns true if given node is medium node in given quadratic element.
def | IsMediumNodeOfAnyElem
| Returns true if given node is medium node in one of quadratic elements.
def | ElemNbEdges
| Returns number of edges for given element.
def | ElemNbFaces
| Returns number of faces for given element.
def | IsPoly
| Returns true if given element is polygon.
def | IsQuadratic
| Returns true if given element is quadratic.
def | BaryCenter
| Returns XYZ coordinates of bary center for given element as list of double If there is not element for given ID - returns empty list.
def | RemoveElements
| Removes elements from mesh by ids.
def | RemoveNodes
| Removes nodes from mesh by ids.
def | AddNode
| Add node to mesh by coordinates.
def | AddEdge
| Create edge both similar and quadratic (this is determed by number of given nodes).
def | AddFace
| Create face both similar and quadratic (this is determed by number of given nodes).
def | AddPolygonalFace
| Add polygonal face to mesh by list of nodes ids.
def | AddVolume
| Create volume both similar and quadratic (this is determed by number of given nodes).
def | AddPolyhedralVolume
| Create volume of many faces, giving nodes for each face.
def | AddPolyhedralVolumeByFaces
| Create volume of many faces, giving IDs of existing faces.
def | MoveNode
| Move node with given id.
def | InverseDiag
| Replace two neighbour triangles sharing Node1-Node2 link with ones built on the same 4 nodes but having other common link.
def | DeleteDiag
| Replace two neighbour triangles sharing Node1-Node2 link with a quadrangle built on the same 4 nodes.
def | Reorient
| Reorient elements by ids.
def | ReorientObject
| Reorient all elements of the object.
def | TriToQuad
| Fuse neighbour triangles into quadrangles.
def | TriToQuadObject
| Fuse neighbour triangles of the object into quadrangles.
def | QuadToTri
| Split quadrangles into triangles.
def | QuadToTriObject
| Split quadrangles into triangles.
def | SplitQuad
| Split quadrangles into triangles.
def | SplitQuadObject
| Split quadrangles into triangles.
def | BestSplit
| Find better splitting of the given quadrangle.
def | Smooth
| Smooth elements.
def | SmoothObject
| Smooth elements belong to given object.
def | SmoothParametric
| Parametric smooth the given elements.
def | SmoothParametricObject
| Parametric smooth elements belong to given object.
def | ConvertToQuadratic
| Converts all mesh to quadratic one, deletes old elements, replacing them with quadratic ones with the same id.
def | ConvertFromQuadratic
| Converts all mesh from quadratic to ordinary ones, deletes old quadratic elements, replacing them with ordinary mesh elements with the same id.
def | RenumberNodes
| Renumber mesh nodes.
def | RenumberElements
| Renumber mesh elements.
def | RotationSweep
| Generate new elements by rotation of the elements around the axis.
def | RotationSweepObject
| Generate new elements by rotation of the elements of object around the axis.
def | ExtrusionSweep
| Generate new elements by extrusion of the elements with given ids.
def | AdvancedExtrusion
| Generate new elements by extrusion of the elements with given ids.
def | ExtrusionSweepObject
| Generate new elements by extrusion of the elements belong to object.
def | ExtrusionSweepObject1D
| Generate new elements by extrusion of the elements belong to object.
def | ExtrusionSweepObject2D
| Generate new elements by extrusion of the elements belong to object.
def | ExtrusionAlongPath
| Generate new elements by extrusion of the given elements A path of extrusion must be a meshed edge.
def | ExtrusionAlongPathObject
| Generate new elements by extrusion of the elements belong to object A path of extrusion must be a meshed edge.
def | Mirror
| Symmetrical copy of mesh elements.
def | MirrorObject
| Symmetrical copy of object.
def | Translate
| Translates the elements.
def | TranslateObject
| Translates the object.
def | Rotate
| Rotates the elements.
def | RotateObject
| Rotates the object.
def | FindCoincidentNodes
| Find group of nodes close to each other within Tolerance.
def | MergeNodes
| Merge nodes.
def | MergeEqualElements
| Remove all but one of elements built on the same nodes.
def | SewFreeBorders
| Sew free borders.
def | SewConformFreeBorders
| Sew conform free borders.
def | SewBorderToSide
| Sew border to side.
def | SewSideElements
| Sew two sides of a mesh.
def | ChangeElemNodes
| Set new nodes for given element.
def | GetLastCreatedNodes
| If during last operation of MeshEditor some nodes were created this method returns list of it's IDs, if new nodes not created - returns empty list.
def | GetLastCreatedElems
| If during last operation of MeshEditor some elements were created this method returns list of it's IDs, if new elements not creared - returns empty list.
## Data Fields
| geom
| mesh
| editor
## Static Public Attributes
int | geom = 0
int | mesh = 0
int | editor = 0

## Detailed Description

The class contains mesh shape, SMESH_Mesh, SMESH_MeshEditor More details.

## Member Function Documentation

def smesh.Mesh.__init__ | ( |  | self,
|  |  | obj = `0`,
|  |  | name = `0`
| ) |

  | Creates mesh on the shape geom(or the empty mesh if geom equal to 0), sets GUI name of this mesh to name. Parameters:
  | obj | Shape to be meshed or SMESH_Mesh object
  | name | Study name of the mesh

def smesh.Mesh.SetMesh | ( |  | self,
|  |  | theMesh
| ) |

  | Parameters:
  | theMesh | is SMESH_Mesh object

def smesh.Mesh.GetMesh | ( |  | self | ) |

| Returns: SMESH_Mesh object

def smesh.Mesh.GetName | ( |  | self | ) |

def smesh.Mesh.SetName | ( |  | self,
|  |  | name
| ) |

def smesh.Mesh.GetSubMesh | ( |  | self,
|  |  | theSubObject,
|  |  | name
| ) |

| The subMesh object gives access to nodes and elements IDs. SubMesh will be used instead of SubShape in a next idl version to adress a specific subMesh...

def smesh.Mesh.GetShape | ( |  | self | ) |

| Returns: GEOM_Object

def smesh.Mesh.SetShape | ( |  | self,
|  |  | geom
| ) |

  | Parameters:
  | geom | shape to be meshed(GEOM_Object)

def smesh.Mesh.IsReadyToCompute | ( |  | self,
|  |  | theSubObject
| ) |

  | Parameters:
  | theMesh | is an instance of Mesh class
  | theSubObject | subshape of a mesh shape

def smesh.Mesh.GetAlgoState | ( |  | self,
|  |  | theSubObject
| ) |

  | Parameters:
  | theMesh | is an instance of Mesh class
  | theSubObject | subshape of a mesh shape
Returns: a list of errors

def smesh.Mesh.GetGeometryByMeshElement | ( |  | self,
|  |  | theElementID,
|  |  | theGeomName
| ) |

  | The returned geometrical object, if not nil, is either found in the study or is published by this method with the given name Parameters:
  | theMesh | is an instance of Mesh class
  | theElementID | an id of the mesh element
  | theGeomName | user defined name of geometrical object
Returns: GEOM.GEOM_Object instance

def smesh.Mesh.MeshDimension | ( |  | self | ) |

def smesh.Mesh.Segment | ( |  | self,
|  |  | algo = `REGULAR`,
|  |  | geom = `0`
| ) |

  | If the optional algo parameter is not sets, this algorithm is REGULAR. If the optional geom parameter is not sets, this algorithm is global. Otherwise, this algorithm define a submesh based on geom subshape. Parameters:
  | algo | values are smesh.REGULAR or smesh.PYTHON for discretization via python function
  | geom | If defined, subshape to be meshed

def smesh.Mesh.Triangle | ( |  | self,
|  |  | algo = `MEFISTO`,
|  |  | geom = `0`
| ) |

  | If the optional geom parameter is not sets, this algorithm is global. Otherwise, this algorithm define a submesh based on geom subshape. Parameters:
  | algo | values are: smesh.MEFISTO or smesh.NETGEN
  | geom | If defined, subshape to be meshed

def smesh.Mesh.Quadrangle | ( |  | self,
|  |  | geom = `0`
| ) |

  | If the optional geom parameter is not sets, this algorithm is global. Otherwise, this algorithm define a submesh based on geom subshape. Parameters:
  | geom | If defined, subshape to be meshed

def smesh.Mesh.Tetrahedron | ( |  | self,
|  |  | algo = `NETGEN`,
|  |  | geom = `0`
| ) |

  | The parameter algo permits to choice the algorithm: NETGEN or GHS3D If the optional geom parameter is not sets, this algorithm is global. Otherwise, this algorithm define a submesh based on geom subshape. Parameters:
  | algo | values are: smesh.NETGEN, smesh.GHS3D, smesh.FULL_NETGEN
  | geom | If defined, subshape to be meshed

def smesh.Mesh.Hexahedron | ( |  | self,
|  |  | geom = `0`
| ) |

  | If the optional geom parameter is not sets, this algorithm is global. Otherwise, this algorithm define a submesh based on geom subshape. Parameters:
  | geom | If defined, subshape to be meshed

def smesh.Mesh.Netgen | ( |  | self,
|  |  | is3D,
|  |  | geom = `0`
| ) |

def smesh.Mesh.Compute | ( |  | self,
|  |  | geom = `0`
| ) |

def smesh.Mesh.AutomaticTetrahedralization | ( |  | self,
|  |  | fineness = `0`
| ) |

def smesh.Mesh.AutomaticHexahedralization | ( |  | self,
|  |  | fineness = `0`
| ) |

def smesh.Mesh.GetHypothesisList | ( |  | self,
|  |  | geom
| ) |

  | Parameters:
  | geom | is subhape of mesh geometry

def smesh.Mesh.RemoveGlobalHypotheses | ( |  | self | ) |

def smesh.Mesh.Group | ( |  | self,
|  |  | grp,
|  |  | name = `""`
| ) |

  | Parameters:
  | grp | is a geometric group, a vertex, an edge, a face or a solid
  | name | is the name of the mesh group
Returns: SMESH_GroupOnGeom

def smesh.Mesh.ExportToMED | ( |  | self,
|  |  | f,
|  |  | version,
|  |  | opt = `0`
| ) |

  | Export the mesh in a file with the MED format and choice the version of MED format Parameters:
  | f | is the file name
  | version | values are SMESH.MED_V2_1, SMESH.MED_V2_2

def smesh.Mesh.ExportMED | ( |  | self,
|  |  | f,
|  |  | auto_groups = `0`,
|  |  | version = `MED_V2_2`
| ) |

  | Parameters:
  | f | is the file name
  | auto_groups | boolean parameter for creating/not creating the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; the typical use is auto_groups=false.
  | version | MED format version(MED_V2_1 or MED_V2_2)

def smesh.Mesh.ExportDAT | ( |  | self,
|  |  | f
| ) |

  | Parameters:
  | f | is the file name

def smesh.Mesh.ExportUNV | ( |  | self,
|  |  | f
| ) |

  | Parameters:
  | f | is the file name

def smesh.Mesh.ExportSTL | ( |  | self,
|  |  | f,
|  |  | ascii = `1`
| ) |

  | Parameters:
  | f | is the file name
  | ascii | defined the kind of file contents

def smesh.Mesh.CreateEmptyGroup | ( |  | self,
|  |  | elementType,
|  |  | name
| ) |

  | Parameters:
  | elementType | is the type of elements in the group
  | name | is the name of the mesh group
Returns: SMESH_Group

def smesh.Mesh.GroupOnGeom | ( |  | self,
|  |  | grp,
|  |  | name = `""`,
|  |  | type = `None`
| ) |

  | Parameters:
  | grp | is a geometric group, a vertex, an edge, a face or a solid
  | name | is the name of the mesh group
Returns: SMESH_GroupOnGeom

def smesh.Mesh.MakeGroupByIds | ( |  | self,
|  |  | groupName,
|  |  | elementType,
|  |  | elemIDs
| ) |

  | Parameters:
  | groupName | is the name of the mesh group
  | elementType | is the type of elements in the group
  | elemIDs | is the list of ids
Returns: SMESH_Group

def smesh.Mesh.MakeGroup | ( |  | self,
|  |  | groupName,
|  |  | elementType,
|  |  | CritType = `FT_Undefined`,
|  |  | Compare = `FT_EqualTo`,
|  |  | Treshold = `""`,
|  |  | UnaryOp = `FT_Undefined`
| ) |

  | Parameters:
  | groupName | is the name of the mesh group
  | elementType | is the type of elements in the group
  | CritType | is type of criterion( FT_Taper, FT_Area, FT_RangeOfIds, FT_LyingOnGeom etc. )
  | Compare | belong to {FT_LessThan, FT_MoreThan, FT_EqualTo}
  | Treshold | is threshold value (range of id ids as string, shape, numeric)
  | UnaryOp | is FT_LogicalNOT or FT_Undefined
Returns: SMESH_Group

def smesh.Mesh.MakeGroupByCriterion | ( |  | self,
|  |  | groupName,
|  |  | Criterion
| ) |

  | Parameters:
  | groupName | is the name of the mesh group
  | Criterion | is the instance of Criterion class
Returns: SMESH_Group

def smesh.Mesh.MakeGroupByCriteria | ( |  | self,
|  |  | groupName,
|  |  | theCriteria
| ) |

  | Parameters:
  | groupName | is the name of the mesh group
  | Criteria | is the list of criterions
Returns: SMESH_Group

def smesh.Mesh.MakeGroupByFilter | ( |  | self,
|  |  | groupName,
|  |  | theFilter
| ) |

  | Parameters:
  | groupName | is the name of the mesh group
  | Criterion | is the instance of Filter class
Returns: SMESH_Group

def smesh.Mesh.GetIdsFromFilter | ( |  | self,
|  |  | theFilter
| ) |

  | Parameters:
  | theFilter | is SMESH_Filter
Returns: list of ids

def smesh.Mesh.GetFreeBorders | ( |  | self | ) |

| Returns: list of SMESH.FreeEdges.Border structure: edge id and two its nodes ids.

def smesh.Mesh.RemoveGroup | ( |  | self,
|  |  | group
| ) |

def smesh.Mesh.RemoveGroupWithContents | ( |  | self,
|  |  | group
| ) |

def smesh.Mesh.GetGroups | ( |  | self | ) |

def smesh.Mesh.GetGroupNames | ( |  | self | ) |

def smesh.Mesh.UnionGroups | ( |  | self,
|  |  | group1,
|  |  | group2,
|  |  | name
| ) |

| All mesh elements that are present in initial groups are added to the new one

def smesh.Mesh.IntersectGroups | ( |  | self,
|  |  | group1,
|  |  | group2,
|  |  | name
| ) |

| All mesh elements that are present in both initial groups are added to the new one.

def smesh.Mesh.CutGroups | ( |  | self,
|  |  | mainGroup,
|  |  | toolGroup,
|  |  | name
| ) |

| All mesh elements that are present in main group but do not present in tool group are added to the new one

def smesh.Mesh.GetLog | ( |  | self,
|  |  | clearAfterGet
| ) |

  | Parameters:
  | clearAfterGet | log is emptied after Get (safe if concurrents access)
Returns: list of log_block structures: commandType number coords indexes

def smesh.Mesh.ClearLog | ( |  | self | ) |

| Must be used immediately after GetLog if clearAfterGet is false.

def smesh.Mesh.GetId | ( |  | self | ) |

def smesh.Mesh.GetStudyId | ( |  | self | ) |

def smesh.Mesh.HasDuplicatedGroupNamesMED | ( |  | self | ) |

| Consider maximum group name length stored in MED file.

def smesh.Mesh.GetMeshEditor | ( |  | self | ) |

def smesh.Mesh.GetMEDMesh | ( |  | self | ) |

def smesh.Mesh.NbNodes | ( |  | self | ) |

def smesh.Mesh.NbElements | ( |  | self | ) |

def smesh.Mesh.NbEdges | ( |  | self | ) |

def smesh.Mesh.NbEdgesOfOrder | ( |  | self,
|  |  | elementOrder
| ) |

  | Parameters:
  | elementOrder | is order of elements: ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC

def smesh.Mesh.NbFaces | ( |  | self | ) |

def smesh.Mesh.NbFacesOfOrder | ( |  | self,
|  |  | elementOrder
| ) |

  | Parameters:
  | elementOrder | is order of elements: ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC

def smesh.Mesh.NbTriangles | ( |  | self | ) |

def smesh.Mesh.NbTrianglesOfOrder | ( |  | self,
|  |  | elementOrder
| ) |

  | Parameters:
  | elementOrder | is order of elements: ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC

def smesh.Mesh.NbQuadrangles | ( |  | self | ) |

def smesh.Mesh.NbQuadranglesOfOrder | ( |  | self,
|  |  | elementOrder
| ) |

  | Parameters:
  | elementOrder | is order of elements: ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC

def smesh.Mesh.NbPolygons | ( |  | self | ) |

def smesh.Mesh.NbVolumes | ( |  | self | ) |

def smesh.Mesh.NbVolumesOfOrder | ( |  | self,
|  |  | elementOrder
| ) |

  | Parameters:
  | elementOrder | is order of elements: ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC

def smesh.Mesh.NbTetras | ( |  | self | ) |

def smesh.Mesh.NbTetrasOfOrder | ( |  | self,
|  |  | elementOrder
| ) |

  | Parameters:
  | elementOrder | is order of elements: ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC

def smesh.Mesh.NbHexas | ( |  | self | ) |

def smesh.Mesh.NbHexasOfOrder | ( |  | self,
|  |  | elementOrder
| ) |

  | Parameters:
  | elementOrder | is order of elements: ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC

def smesh.Mesh.NbPyramids | ( |  | self | ) |

def smesh.Mesh.NbPyramidsOfOrder | ( |  | self,
|  |  | elementOrder
| ) |

  | Parameters:
  | elementOrder | is order of elements: ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC

def smesh.Mesh.NbPrisms | ( |  | self | ) |

def smesh.Mesh.NbPrismsOfOrder | ( |  | self,
|  |  | elementOrder
| ) |

  | Parameters:
  | elementOrder | is order of elements: ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC

def smesh.Mesh.NbPolyhedrons | ( |  | self | ) |

def smesh.Mesh.NbSubMesh | ( |  | self | ) |

def smesh.Mesh.GetElementsId | ( |  | self | ) |

def smesh.Mesh.GetElementsByType | ( |  | self,
|  |  | elementType
| ) |

  | Parameters:
  | elementType | is required type of elements

def smesh.Mesh.GetNodesId | ( |  | self | ) |

def smesh.Mesh.GetElementType | ( |  | self,
|  |  | id,
|  |  | iselem
| ) |

def smesh.Mesh.GetSubMeshElementsId | ( |  | self,
|  |  | shapeID
| ) |

  | Parameters:
  | shapeID | is geom object(subshape) IOR

def smesh.Mesh.GetSubMeshNodesId | ( |  | self,
|  |  | shapeID,
|  |  | all
| ) |

  | Parameters:
  | shapeID | is geom object(subshape) IOR

def smesh.Mesh.GetSubMeshElementType | ( |  | self,
|  |  | shapeID
| ) |

  | Parameters:
  | shapeID | is geom object(subshape) IOR

def smesh.Mesh.Dump | ( |  | self | ) |

def smesh.Mesh.GetNodeXYZ | ( |  | self,
|  |  | id
| ) |

def smesh.Mesh.GetNodeInverseElements | ( |  | self,
|  |  | id
| ) |

def smesh.Mesh.GetShapeID | ( |  | self,
|  |  | id
| ) |

def smesh.Mesh.GetShapeIDForElem | ( |  | id | ) |

def smesh.Mesh.GetElemNbNodes | ( |  | self,
|  |  | id
| ) |

def smesh.Mesh.GetElemNode | ( |  | self,
|  |  | id,
|  |  | index
| ) |

def smesh.Mesh.IsMediumNode | ( |  | self,
|  |  | elementID,
|  |  | nodeID
| ) |

def smesh.Mesh.IsMediumNodeOfAnyElem | ( |  | self,
|  |  | nodeID,
|  |  | elementType
| ) |

def smesh.Mesh.ElemNbEdges | ( |  | self,
|  |  | id
| ) |

def smesh.Mesh.ElemNbFaces | ( |  | self,
|  |  | id
| ) |

def smesh.Mesh.IsPoly | ( |  | self,
|  |  | id
| ) |

def smesh.Mesh.IsQuadratic | ( |  | self,
|  |  | id
| ) |

def smesh.Mesh.BaryCenter | ( |  | self,
|  |  | id
| ) |

def smesh.Mesh.RemoveElements | ( |  | self,
|  |  | IDsOfElements
| ) |

  | Parameters:
  | IDsOfElements | is list of ids of elements to remove

def smesh.Mesh.RemoveNodes | ( |  | self,
|  |  | IDsOfNodes
| ) |

  | Parameters:
  | IDsOfNodes | is list of ids of nodes to remove

def smesh.Mesh.AddNode | ( |  | self,
|  |  | x,
|  |  | y,
|  |  | z
| ) |

def smesh.Mesh.AddEdge | ( |  | self,
|  |  | IDsOfNodes
| ) |

  | Parameters:
  | IdsOfNodes | List of node IDs for creation of element. Needed order of nodes in this list corresponds to description of MED. This description is located by the following link: http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.

def smesh.Mesh.AddFace | ( |  | self,
|  |  | IDsOfNodes
| ) |

  | Parameters:
  | IdsOfNodes | List of node IDs for creation of element. Needed order of nodes in this list corresponds to description of MED. This description is located by the following link: http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.

def smesh.Mesh.AddPolygonalFace | ( |  | self,
|  |  | IdsOfNodes
| ) |

def smesh.Mesh.AddVolume | ( |  | self,
|  |  | IDsOfNodes
| ) |

  | Parameters:
  | IdsOfNodes | List of node IDs for creation of element. Needed order of nodes in this list corresponds to description of MED. This description is located by the following link: http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.

def smesh.Mesh.AddPolyhedralVolume | ( |  | self,
|  |  | IdsOfNodes,
|  |  | Quantities
| ) |

  | Parameters:
  | IdsOfNodes | List of node IDs for volume creation face by face.
  | Quantities | List of integer values, Quantities[i] gives quantity of nodes in face number i.

def smesh.Mesh.AddPolyhedralVolumeByFaces | ( |  | self,
|  |  | IdsOfFaces
| ) |

  | Parameters:
  | IdsOfFaces | List of face IDs for volume creation.
Note: The created volume will refer only to nodes of the given faces, not to the faces itself.

def smesh.Mesh.MoveNode | ( |  | self,
|  |  | NodeID,
|  |  | x,
|  |  | y,
|  |  | z
| ) |

  | Parameters:
  | NodeID | id of the node
  | x | displacing along the X axis
  | y | displacing along the Y axis
  | z | displacing along the Z axis

def smesh.Mesh.InverseDiag | ( |  | self,
|  |  | NodeID1,
|  |  | NodeID2
| ) |

  | Parameters:
  | NodeID1 | first node id
  | NodeID2 | second node id
Returns: false if proper faces not found

def smesh.Mesh.DeleteDiag | ( |  | self,
|  |  | NodeID1,
|  |  | NodeID2
| ) |

  | Parameters:
  | NodeID1 | first node id
  | NodeID2 | second node id
Returns: false if proper faces not found

def smesh.Mesh.Reorient | ( |  | self,
|  |  | IDsOfElements = `None`
| ) |

  | Parameters:
  | IDsOfElements | if undefined reorient all mesh elements

def smesh.Mesh.ReorientObject | ( |  | self,
|  |  | theObject
| ) |

  | Parameters:
  | theObject | is mesh, submesh or group

def smesh.Mesh.TriToQuad | ( |  | self,
|  |  | IDsOfElements,
|  |  | theCriterion,
|  |  | MaxAngle
| ) |

  | Parameters:
  | IDsOfElements | The triangles to be fused,
  | theCriterion | is FT_...; used to choose a neighbour to fuse with.
  | MaxAngle | is a max angle between element normals at which fusion is still performed; theMaxAngle is mesured in radians.
Returns: TRUE in case of success, FALSE otherwise.

def smesh.Mesh.TriToQuadObject | ( |  | self,
|  |  | theObject,
|  |  | theCriterion,
|  |  | MaxAngle
| ) |

  | Parameters:
  | theObject | is mesh, submesh or group
  | theCriterion | is FT_...; used to choose a neighbour to fuse with.
  | MaxAngle | is a max angle between element normals at which fusion is still performed; theMaxAngle is mesured in radians.
Returns: TRUE in case of success, FALSE otherwise.

def smesh.Mesh.QuadToTri | ( |  | self,
|  |  | IDsOfElements,
|  |  | theCriterion
| ) |

  | Parameters:
  | IDsOfElements | the faces to be splitted.
  | theCriterion | is FT_...; used to choose a diagonal for splitting.
  |  | TRUE in case of success, FALSE otherwise.

def smesh.Mesh.QuadToTriObject | ( |  | self,
|  |  | theObject,
|  |  | theCriterion
| ) |

  | Parameters:
  | theObject | object to taking list of elements from, is mesh, submesh or group
  | theCriterion | is FT_...; used to choose a diagonal for splitting.

def smesh.Mesh.SplitQuad | ( |  | self,
|  |  | IDsOfElements,
|  |  | Diag13
| ) |

  | Parameters:
  | theElems | The faces to be splitted
  | the13Diag | is used to choose a diagonal for splitting.
Returns: TRUE in case of success, FALSE otherwise.

def smesh.Mesh.SplitQuadObject | ( |  | self,
|  |  | theObject,
|  |  | Diag13
| ) |

  | Parameters:
  | theObject | is object to taking list of elements from, is mesh, submesh or group

def smesh.Mesh.BestSplit | ( |  | self,
|  |  | IDOfQuad,
|  |  | theCriterion
| ) |

  | Parameters:
  | IDOfQuad | ID of the quadrangle to be splitted.
  | theCriterion | is FT_...; a criterion to choose a diagonal for splitting.
Returns: 1 if 1-3 diagonal is better, 2 if 2-4 diagonal is better, 0 if error occurs.

def smesh.Mesh.Smooth | ( |  | self,
|  |  | IDsOfElements,
|  |  | IDsOfFixedNodes,
|  |  | MaxNbOfIterations,
|  |  | MaxAspectRatio,
|  |  | Method
| ) |

  | Parameters:
  | IDsOfElements | list if ids of elements to smooth
  | IDsOfFixedNodes | list of ids of fixed nodes. Note that nodes built on edges and boundary nodes are always fixed.
  | MaxNbOfIterations | maximum number of iterations
  | MaxAspectRatio | varies in range [1.0, inf]
  | Method | is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH)

def smesh.Mesh.SmoothObject | ( |  | self,
|  |  | theObject,
|  |  | IDsOfFixedNodes,
|  |  | MaxNbOfIterations,
|  |  | MaxxAspectRatio,
|  |  | Method
| ) |

  | Parameters:
  | theObject | object to smooth
  | IDsOfFixedNodes | list of ids of fixed nodes. Note that nodes built on edges and boundary nodes are always fixed.
  | MaxNbOfIterations | maximum number of iterations
  | MaxAspectRatio | varies in range [1.0, inf]
  | Method | is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH)

def smesh.Mesh.SmoothParametric | ( |  | IDsOfElements,
|  |  | IDsOfFixedNodes,
|  |  | MaxNbOfIterations,
|  |  | MaxAspectRatio,
|  |  | Method
| ) |

  | Parameters:
  | IDsOfElements | list if ids of elements to smooth
  | IDsOfFixedNodes | list of ids of fixed nodes. Note that nodes built on edges and boundary nodes are always fixed.
  | MaxNbOfIterations | maximum number of iterations
  | MaxAspectRatio | varies in range [1.0, inf]
  | Method | is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH)

def smesh.Mesh.SmoothParametricObject | ( |  | self,
|  |  | theObject,
|  |  | IDsOfFixedNodes,
|  |  | MaxNbOfIterations,
|  |  | MaxAspectRatio,
|  |  | Method
| ) |

  | Parameters:
  | theObject | object to smooth
  | IDsOfFixedNodes | list of ids of fixed nodes. Note that nodes built on edges and boundary nodes are always fixed.
  | MaxNbOfIterations | maximum number of iterations
  | MaxAspectRatio | varies in range [1.0, inf]
  | Method | is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH)

def smesh.Mesh.ConvertToQuadratic | ( |  | self,
|  |  | theForce3d
| ) |

def smesh.Mesh.ConvertFromQuadratic | ( |  | self | ) |

def smesh.Mesh.RenumberNodes | ( |  | self | ) |

def smesh.Mesh.RenumberElements | ( |  | self | ) |

def smesh.Mesh.RotationSweep | ( |  | self,
|  |  | IDsOfElements,
|  |  | Axix,
|  |  | AngleInRadians,
|  |  | NbOfSteps,
|  |  | Tolerance
| ) |

  | Parameters:
  | IDsOfElements | list of ids of elements to sweep
  | Axix | axis of rotation, AxisStruct or line(geom object)
  | AngleInRadians | angle of Rotation
  | NbOfSteps | number of steps
  | Tolerance | tolerance

def smesh.Mesh.RotationSweepObject | ( |  | self,
|  |  | theObject,
|  |  | Axix,
|  |  | AngleInRadians,
|  |  | NbOfSteps,
|  |  | Tolerance
| ) |

  | Parameters:
  | theObject | object wich elements should be sweeped
  | Axix | axis of rotation, AxisStruct or line(geom object)
  | AngleInRadians | angle of Rotation
  | NbOfSteps | number of steps
  | Tolerance | tolerance

def smesh.Mesh.ExtrusionSweep | ( |  | self,
|  |  | IDsOfElements,
|  |  | StepVector,
|  |  | NbOfSteps
| ) |

  | Parameters:
  | IDsOfElements | list of elements ids for extrusion
  | StepVector | vector, defining the direction and value of extrusion
  | NbOfSteps | the number of steps

def smesh.Mesh.AdvancedExtrusion | ( |  | self,
|  |  | IDsOfElements,
|  |  | StepVector,
|  |  | NbOfSteps,
|  |  | ExtrFlags,
|  |  | SewTolerance
| ) |

  | Parameters:
  | IDsOfElements | is ids of elements
  | StepVector | vector, defining the direction and value of extrusion
  | NbOfSteps | the number of steps
  | ExtrFlags | set flags for performing extrusion
  | SewTolerance | uses for comparing locations of nodes if flag EXTRUSION_FLAG_SEW is set

def smesh.Mesh.ExtrusionSweepObject | ( |  | self,
|  |  | theObject,
|  |  | StepVector,
|  |  | NbOfSteps
| ) |

  | Parameters:
  | theObject | object wich elements should be processed
  | StepVector | vector, defining the direction and value of extrusion
  | NbOfSteps | the number of steps

def smesh.Mesh.ExtrusionSweepObject1D | ( |  | self,
|  |  | theObject,
|  |  | StepVector,
|  |  | NbOfSteps
| ) |

  | Parameters:
  | theObject | object wich elements should be processed
  | StepVector | vector, defining the direction and value of extrusion
  | NbOfSteps | the number of steps

def smesh.Mesh.ExtrusionSweepObject2D | ( |  | self,
|  |  | theObject,
|  |  | StepVector,
|  |  | NbOfSteps
| ) |

  | Parameters:
  | theObject | object wich elements should be processed
  | StepVector | vector, defining the direction and value of extrusion
  | NbOfSteps | the number of steps

def smesh.Mesh.ExtrusionAlongPath | ( |  | self,
|  |  | IDsOfElements,
|  |  | PathMesh,
|  |  | PathShape,
|  |  | NodeStart,
|  |  | HasAngles,
|  |  | Angles,
|  |  | HasRefPoint,
|  |  | RefPoint
| ) |

  | Parameters:
  | IDsOfElements | is ids of elements
  | PathMesh | mesh containing a 1D sub-mesh on the edge, along which proceeds the extrusion
  | PathShape | is shape(edge); as the mesh can be complex, the edge is used to define the sub-mesh for the path
  | NodeStart | the first or the last node on the edge. It is used to define the direction of extrusion
  | HasAngles | allows the shape to be rotated around the path to get the resulting mesh in a helical fashion
  | Angles | list of angles
  | HasRefPoint | allows to use base point
  | RefPoint | point around which the shape is rotated(the mass center of the shape by default). User can specify any point as the Base Point and the shape will be rotated with respect to this point.

def smesh.Mesh.ExtrusionAlongPathObject | ( |  | self,
|  |  | theObject,
|  |  | PathMesh,
|  |  | PathShape,
|  |  | NodeStart,
|  |  | HasAngles,
|  |  | Angles,
|  |  | HasRefPoint,
|  |  | RefPoint
| ) |

  | Parameters:
  | IDsOfElements | is ids of elements
  | PathMesh | mesh containing a 1D sub-mesh on the edge, along which proceeds the extrusion
  | PathShape | is shape(edge); as the mesh can be complex, the edge is used to define the sub-mesh for the path
  | NodeStart | the first or the last node on the edge. It is used to define the direction of extrusion
  | HasAngles | allows the shape to be rotated around the path to get the resulting mesh in a helical fashion
  | Angles | list of angles
  | HasRefPoint | allows to use base point
  | RefPoint | point around which the shape is rotated(the mass center of the shape by default). User can specify any point as the Base Point and the shape will be rotated with respect to this point.

def smesh.Mesh.Mirror | ( |  | self,
|  |  | IDsOfElements,
|  |  | Mirror,
|  |  | theMirrorType,
|  |  | Copy = `0`
| ) |

  | Parameters:
  | IDsOfElements | list of elements ids
  | Mirror | is AxisStruct or geom object(point, line, plane)
  | theMirrorType | is POINT, AXIS or PLANE If the Mirror is geom object this parameter is unnecessary
  | Copy | allows to copy element(Copy is 1) or to replace with its mirroring(Copy is 0)

def smesh.Mesh.MirrorObject | ( |  | self,
|  |  | theObject,
|  |  | Mirror,
|  |  | theMirrorType,
|  |  | Copy = `0`
| ) |

  | Parameters:
  | theObject | mesh, submesh or group
  | Mirror | is AxisStruct or geom object(point, line, plane)
  | theMirrorType | is POINT, AXIS or PLANE If the Mirror is geom object this parameter is unnecessary
  | Copy | allows to copy element(Copy is 1) or to replace with its mirroring(Copy is 0)

def smesh.Mesh.Translate | ( |  | self,
|  |  | IDsOfElements,
|  |  | Vector,
|  |  | Copy
| ) |

  | Parameters:
  | IDsOfElements | list of elements ids
  | Vector | direction of translation(DirStruct or vector)
  | Copy | allows to copy the translated elements

def smesh.Mesh.TranslateObject | ( |  | self,
|  |  | theObject,
|  |  | Vector,
|  |  | Copy
| ) |

  | Parameters:
  | theObject | object to translate(mesh, submesh, or group)
  | Vector | direction of translation(DirStruct or geom vector)
  | Copy | allows to copy the translated elements

def smesh.Mesh.Rotate | ( |  | self,
|  |  | IDsOfElements,
|  |  | Axis,
|  |  | AngleInRadians,
|  |  | Copy
| ) |

  | Parameters:
  | IDsOfElements | list of elements ids
  | Axis | axis of rotation(AxisStruct or geom line)
  | AngleInRadians | angle of rotation(in radians)
  | Copy | allows to copy the rotated elements

def smesh.Mesh.RotateObject | ( |  | self,
|  |  | theObject,
|  |  | Axis,
|  |  | AngleInRadians,
|  |  | Copy
| ) |

  | Parameters:
  | theObject | object to rotate(mesh, submesh, or group)
  | Axis | axis of rotation(AxisStruct or geom line)
  | AngleInRadians | angle of rotation(in radians)
  | Copy | allows to copy the rotated elements

def smesh.Mesh.FindCoincidentNodes | ( |  | self,
|  |  | Tolerance
| ) |

  | Parameters:
  | Tolerance | tolerance value
  | list | of group of nodes

def smesh.Mesh.MergeNodes | ( |  | self,
|  |  | GroupsOfNodes
| ) |

  | Parameters:
  | list | of group of nodes

def smesh.Mesh.MergeEqualElements | ( |  | self | ) |

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

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

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

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

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

def smesh.Mesh.ChangeElemNodes | ( |  | self,
|  |  | ide,
|  |  | newIDs
| ) |

  | Parameters:
  | ide | the element id
  | newIDs | nodes ids
Returns: If number of nodes is not corresponded to type of element - returns false

def smesh.Mesh.GetLastCreatedNodes | ( |  | self | ) |

def smesh.Mesh.GetLastCreatedElems | ( |  | self | ) |

## Field Documentation

int smesh.Mesh.geom = 0`[static]`

int smesh.Mesh.mesh = 0`[static]`

int smesh.Mesh.editor = 0`[static]`

smesh.Mesh.geom

smesh.Mesh.mesh

smesh.Mesh.editor