Version: 8.3.0
Home
 All Data Structures Namespaces Files Functions Variables Groups
Quality controls and Filtering

Functions

def GetEmptyCriterion
 Create an empty criterion. More...
 
def GetCriterion
 Create a criterion by the given parameters
Criterion structures allow to define complex filters by combining them with logical operations (AND / OR) (see example below) More...
 
def GetFilter
 Create a filter with the given parameters. More...
 
def GetFilterFromCriteria
 Create a filter from criteria. More...
 
def GetFunctor
 Create a numerical functor by its type. More...
 
def GetIdsFromFilter
 Pass mesh elements through the given filter and return IDs of fitting elements. More...
 

Detailed Description

Function Documentation

def GetEmptyCriterion (   self)

Create an empty criterion.

Returns
SMESH.Filter.Criterion

References smeshBuilder.EnumToLong(), and smeshBuilder.GetCriterion().

def GetCriterion (   self,
  elementType,
  CritType,
  Compare = FT_EqualTo,
  Threshold = "",
  UnaryOp = FT_Undefined,
  BinaryOp = FT_Undefined,
  Tolerance = 1e-07 
)

Create a criterion by the given parameters
Criterion structures allow to define complex filters by combining them with logical operations (AND / OR) (see example below)

Parameters
elementTypethe type of elements(SMESH.NODE, SMESH.EDGE, SMESH.FACE, SMESH.VOLUME)
CritTypethe type of criterion (SMESH.FT_Taper, SMESH.FT_Area, etc.) Type SMESH.FunctorType._items in the Python Console to see all values. Note that the items starting from FT_LessThan are not suitable for CritType.
Comparebelongs to {SMESH.FT_LessThan, SMESH.FT_MoreThan, SMESH.FT_EqualTo}
Thresholdthe threshold value (range of ids as string, shape, numeric)
UnaryOpSMESH.FT_LogicalNOT or SMESH.FT_Undefined
BinaryOpa binary logical operation SMESH.FT_LogicalAND, SMESH.FT_LogicalOR or SMESH.FT_Undefined
Tolerancethe tolerance used by SMESH.FT_BelongToGeom, SMESH.FT_BelongToSurface, SMESH.FT_LyingOnGeom, SMESH.FT_CoplanarFaces criteria
Returns
SMESH.Filter.Criterion

Example of Criteria usage

References smeshBuilder.ColorToString(), smeshBuilder.EnumToLong(), smeshBuilder.GetCurrentStudy(), smeshBuilder.GetEmptyCriterion(), smeshBuilder.GetFilter(), and smeshBuilder.GetName().

def GetFilter (   self,
  elementType,
  CritType = FT_Undefined,
  Compare = FT_EqualTo,
  Threshold = "",
  UnaryOp = FT_Undefined,
  Tolerance = 1e-07,
  mesh = None 
)

Create a filter with the given parameters.

Parameters
elementTypethe type of elements (SMESH.NODE, SMESH.EDGE, SMESH.FACE, SMESH.VOLUME)
CritTypethe type of criterion (SMESH.FT_Taper, SMESH.FT_Area, etc.) Type SMESH.FunctorType._items in the Python Console to see all values. Note that the items starting from FT_LessThan are not suitable for CritType.
Comparebelongs to {SMESH.FT_LessThan, SMESH.FT_MoreThan, SMESH.FT_EqualTo}
Thresholdthe threshold value (range of ids as string, shape, numeric)
UnaryOpSMESH.FT_LogicalNOT or SMESH.FT_Undefined
Tolerancethe tolerance used by SMESH.FT_BelongToGeom, SMESH.FT_BelongToSurface, SMESH.FT_LyingOnGeom, SMESH.FT_CoplanarFaces and SMESH.FT_EqualNodes criteria
meshthe mesh to initialize the filter with
Returns
SMESH_Filter

Example of Filters usage

References smeshBuilder.GetCriterion().

def GetFilterFromCriteria (   self,
  criteria,
  binOp = SMESH.FT_LogicalAND 
)

Create a filter from criteria.

Parameters
criteriaa list of criteria
binOpbinary operator used when binary operator of criteria is undefined
Returns
SMESH_Filter

Example of Filters usage

References smeshBuilder.EnumToLong().

def GetFunctor (   self,
  theCriterion 
)

Create a numerical functor by its type.

Parameters
theCriterionfunctor type - an item of SMESH.FunctorType enumeration. Type SMESH.FunctorType._items in the Python Console to see all items. Note that not all items correspond to numerical functors.
Returns
SMESH_NumericalFunctor
def GetIdsFromFilter (   self,
  theFilter 
)

Pass mesh elements through the given filter and return IDs of fitting elements.

Parameters
theFilterSMESH_Filter
Returns
a list of ids

References Mesh.mesh.