Back to index

salome-smesh  6.5.0
Functions
Measurements

Functions

def smeshDC.smeshDC.MinDistance
 Get minimum distance between two objects.
def smeshDC.smeshDC.GetMinDistance
 Get measure structure specifying minimum distance data between two objects.
def smeshDC.smeshDC.BoundingBox
 Get bounding box of the specified object(s)
def smeshDC.smeshDC.GetBoundingBox
 Get measure structure specifying bounding box data of the specified object(s)
def smeshDC.Mesh.GetLength
 Get length of 1D element.
def smeshDC.Mesh.GetArea
 Get area of 2D element.
def smeshDC.Mesh.GetVolume
 Get volume of 3D element.
def smeshDC.Mesh.GetMaxElementLength
 Get maximum element length.
def smeshDC.Mesh.GetAspectRatio
 Get aspect ratio of 2D or 3D element.
def smeshDC.Mesh.GetWarping
 Get warping angle of 2D element.
def smeshDC.Mesh.GetMinimumAngle
 Get minimum angle of 2D element.
def smeshDC.Mesh.GetTaper
 Get taper of 2D element.
def smeshDC.Mesh.GetSkew
 Get skew of 2D element.

Function Documentation

def smeshDC.smeshDC.BoundingBox (   self,
  objects 
)

Get bounding box of the specified object(s)

Parameters:
objectssingle source object or list of source objects
Returns:
tuple of six values (minX, minY, minZ, maxX, maxY, maxZ)
See also:
GetBoundingBox()

Definition at line 901 of file smeshDC.py.

00901 
00902     def BoundingBox(self, objects):
00903         result = self.GetBoundingBox(objects)
00904         if result is None:
00905             result = (0.0,)*6
00906         else:
00907             result = (result.minX, result.minY, result.minZ, result.maxX, result.maxY, result.maxZ)
00908         return result

Here is the call graph for this function:

def smeshDC.Mesh.GetArea (   self,
  elemId 
)

Get area of 2D element.

Parameters:
elemIdmesh element ID
Returns:
element's area value

Definition at line 3961 of file smeshDC.py.

03961 
03962     def GetArea(self, elemId):
03963         return self._valueFromFunctor(SMESH.FT_Area, elemId)

Here is the call graph for this function:

def smeshDC.Mesh.GetAspectRatio (   self,
  elemId 
)

Get aspect ratio of 2D or 3D element.

Parameters:
elemIdmesh element ID
Returns:
element's aspect ratio value

Definition at line 3986 of file smeshDC.py.

03986 
03987     def GetAspectRatio(self, elemId):
03988         if self.GetElementType(elemId, True) == SMESH.VOLUME:
03989             ftype = SMESH.FT_AspectRatio3D
03990         else:
03991             ftype = SMESH.FT_AspectRatio
03992         return self._valueFromFunctor(ftype, elemId)

Here is the call graph for this function:

def smeshDC.smeshDC.GetBoundingBox (   self,
  objects 
)

Get measure structure specifying bounding box data of the specified object(s)

Parameters:
objectssingle source object or list of source objects
Returns:
Measure structure
See also:
BoundingBox()

Definition at line 914 of file smeshDC.py.

00914 
00915     def GetBoundingBox(self, objects):
00916         if isinstance(objects, tuple):
00917             objects = list(objects)
00918         if not isinstance(objects, list):
00919             objects = [objects]
00920         srclist = []
00921         for o in objects:
00922             if isinstance(o, Mesh):
00923                 srclist.append(o.mesh)
00924             elif hasattr(o, "_narrow"):
00925                 src = o._narrow(SMESH.SMESH_IDSource)
00926                 if src: srclist.append(src)
00927                 pass
00928             pass
00929         aMeasurements = self.CreateMeasurements()
00930         result = aMeasurements.BoundingBox(srclist)
00931         aMeasurements.UnRegister()
00932         return result

Here is the call graph for this function:

Here is the caller graph for this function:

def smeshDC.Mesh.GetLength (   self,
  elemId 
)

Get length of 1D element.

Parameters:
elemIdmesh element ID
Returns:
element's length value

Definition at line 3954 of file smeshDC.py.

03954 
03955     def GetLength(self, elemId):
03956         return self._valueFromFunctor(SMESH.FT_Length, elemId)

Here is the call graph for this function:

def smeshDC.Mesh.GetMaxElementLength (   self,
  elemId 
)

Get maximum element length.

Parameters:
elemIdmesh element ID
Returns:
element's maximum length value

Definition at line 3975 of file smeshDC.py.

03975 
03976     def GetMaxElementLength(self, elemId):
03977         if self.GetElementType(elemId, True) == SMESH.VOLUME:
03978             ftype = SMESH.FT_MaxElementLength3D
03979         else:
03980             ftype = SMESH.FT_MaxElementLength2D
03981         return self._valueFromFunctor(ftype, elemId)

Here is the call graph for this function:

def smeshDC.smeshDC.GetMinDistance (   self,
  src1,
  src2 = None,
  id1 = 0,
  id2 = 0,
  isElem1 = False,
  isElem2 = False 
)

Get measure structure specifying minimum distance data between two objects.

If src2 is None, and id2 = 0, distance from src1 / id1 to the origin is computed. If src2 is None, and id2 != 0, it is assumed that both id1 and id2 belong to src1.

Parameters:
src1first source object
src2second source object
id1node/element id from the first source
id2node/element id from the second (or first) source
isElem1True if id1 is element id, False if it is node id
isElem2True if id2 is element id, False if it is node id
Returns:
Measure structure or None if input data is invalid
See also:
MinDistance()

Definition at line 865 of file smeshDC.py.

00865 
00866     def GetMinDistance(self, src1, src2=None, id1=0, id2=0, isElem1=False, isElem2=False):
00867         if isinstance(src1, Mesh): src1 = src1.mesh
00868         if isinstance(src2, Mesh): src2 = src2.mesh
00869         if src2 is None and id2 != 0: src2 = src1
00870         if not hasattr(src1, "_narrow"): return None
00871         src1 = src1._narrow(SMESH.SMESH_IDSource)
00872         if not src1: return None
00873         if id1 != 0:
00874             m = src1.GetMesh()
00875             e = m.GetMeshEditor()
00876             if isElem1:
00877                 src1 = e.MakeIDSource([id1], SMESH.FACE)
00878             else:
00879                 src1 = e.MakeIDSource([id1], SMESH.NODE)
00880             pass
00881         if hasattr(src2, "_narrow"):
00882             src2 = src2._narrow(SMESH.SMESH_IDSource)
00883             if src2 and id2 != 0:
00884                 m = src2.GetMesh()
00885                 e = m.GetMeshEditor()
00886                 if isElem2:
00887                     src2 = e.MakeIDSource([id2], SMESH.FACE)
00888                 else:
00889                     src2 = e.MakeIDSource([id2], SMESH.NODE)
00890                 pass
00891             pass
00892         aMeasurements = self.CreateMeasurements()
00893         result = aMeasurements.MinDistance(src1, src2)
00894         aMeasurements.UnRegister()
00895         return result

Here is the call graph for this function:

Here is the caller graph for this function:

def smeshDC.Mesh.GetMinimumAngle (   self,
  elemId 
)

Get minimum angle of 2D element.

Parameters:
elemIdmesh element ID
Returns:
element's minimum angle value

Definition at line 4004 of file smeshDC.py.

04004 
04005     def GetMinimumAngle(self, elemId):
04006         return self._valueFromFunctor(SMESH.FT_MinimumAngle, elemId)

Here is the call graph for this function:

def smeshDC.Mesh.GetSkew (   self,
  elemId 
)

Get skew of 2D element.

Parameters:
elemIdmesh element ID
Returns:
element's skew value

Definition at line 4018 of file smeshDC.py.

04018 
04019     def GetSkew(self, elemId):
04020         return self._valueFromFunctor(SMESH.FT_Skew, elemId)

Here is the call graph for this function:

def smeshDC.Mesh.GetTaper (   self,
  elemId 
)

Get taper of 2D element.

Parameters:
elemIdmesh element ID
Returns:
element's taper value

Definition at line 4011 of file smeshDC.py.

04011 
04012     def GetTaper(self, elemId):
04013         return self._valueFromFunctor(SMESH.FT_Taper, elemId)

Here is the call graph for this function:

def smeshDC.Mesh.GetVolume (   self,
  elemId 
)

Get volume of 3D element.

Parameters:
elemIdmesh element ID
Returns:
element's volume value

Definition at line 3968 of file smeshDC.py.

03968 
03969     def GetVolume(self, elemId):
03970         return self._valueFromFunctor(SMESH.FT_Volume3D, elemId)

Here is the call graph for this function:

def smeshDC.Mesh.GetWarping (   self,
  elemId 
)

Get warping angle of 2D element.

Parameters:
elemIdmesh element ID
Returns:
element's warping angle value

Definition at line 3997 of file smeshDC.py.

03997 
03998     def GetWarping(self, elemId):
03999         return self._valueFromFunctor(SMESH.FT_Warping, elemId)

Here is the call graph for this function:

def smeshDC.smeshDC.MinDistance (   self,
  src1,
  src2 = None,
  id1 = 0,
  id2 = 0,
  isElem1 = False,
  isElem2 = False 
)

Get minimum distance between two objects.

If src2 is None, and id2 = 0, distance from src1 / id1 to the origin is computed. If src2 is None, and id2 != 0, it is assumed that both id1 and id2 belong to src1.

Parameters:
src1first source object
src2second source object
id1node/element id from the first source
id2node/element id from the second (or first) source
isElem1True if id1 is element id, False if it is node id
isElem2True if id2 is element id, False if it is node id
Returns:
minimum distance value
See also:
GetMinDistance()

Definition at line 843 of file smeshDC.py.

00843 
00844     def MinDistance(self, src1, src2=None, id1=0, id2=0, isElem1=False, isElem2=False):
00845         result = self.GetMinDistance(src1, src2, id1, id2, isElem1, isElem2)
00846         if result is None:
00847             result = 0.0
00848         else:
00849             result = result.value
00850         return result

Here is the call graph for this function: