# @param UnaryOp FT_LogicalNOT or FT_Undefined
# @param Tolerance the tolerance used by FT_BelongToGeom, FT_BelongToSurface,
# FT_LyingOnGeom, FT_CoplanarFaces and FT_EqualNodes criteria
+ # @param mesh the mesh to initialize the filter with
# @return SMESH_Filter
#
# <a href="../tui_filters_page.html#tui_filters">Example of Filters usage</a>
if errText: errText += ". "
errText += err.comment
if allReasons != "":allReasons += "\n"
- allReasons += '- "%s" failed%s. Error: %s' %(err.algoName, shapeText, errText)
+ if ok:
+ allReasons += '- "%s"%s - %s' %(err.algoName, shapeText, errText)
+ else:
+ allReasons += '- "%s" failed%s. Error: %s' %(err.algoName, shapeText, errText)
pass
# Treat hyp errors
return self.editor.TriToQuadObject(theObject, Functor, MaxAngle)
## Splits quadrangles into triangles.
- #
# @param IDsOfElements the faces to be splitted.
# @param theCriterion is a numerical functor, in terms of enum SMESH.FunctorType, used to
# choose a diagonal for splitting. If @a theCriterion is None, which is a default
Functor = self.smeshpyD.GetFunctor(theCriterion)
return self.editor.QuadToTriObject(theObject, Functor)
+ ## Splits each of given quadrangles into 4 triangles. A node is added at the center of
+ # a quadrangle.
+ # @param theElements the faces to be splitted. This can be either mesh, sub-mesh,
+ # group or a list of face IDs. By default all quadrangles are split
+ # @ingroup l2_modif_cutquadr
+ def QuadTo4Tri (self, theElements=[]):
+ if isinstance( theElements, Mesh ):
+ theElements = theElements.mesh
+ elif not theElements:
+ theElements = self.mesh
+ elif isinstance( theElements, list ):
+ theElements = self.GetIDSource( theElements, SMESH.FACE )
+ return self.editor.QuadTo4Tri( theElements )
+
## Splits quadrangles into triangles.
# @param IDsOfElements the faces to be splitted
# @param Diag13 is used to choose a diagonal for splitting.
# @param theToBiQuad If True, converts the mesh to bi-quadratic
# @ingroup l2_modif_tofromqu
def ConvertToQuadratic(self, theForce3d, theSubMesh=None, theToBiQuad=False):
+ if isinstance( theSubMesh, Mesh ):
+ theSubMesh = theSubMesh.mesh
if theToBiQuad:
self.editor.ConvertToBiQuadratic(theForce3d,theSubMesh)
else:
self.editor.ConvertToQuadraticObject(theForce3d,theSubMesh)
else:
self.editor.ConvertToQuadratic(theForce3d)
+ error = self.editor.GetLastError()
+ if error and error.comment:
+ print error.comment
## Converts the mesh from quadratic to ordinary,
# deletes old quadratic elements, \n replacing