X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_SWIG%2FsmeshBuilder.py;h=a7ddf41916821c16995785da19ea8d634d405a51;hb=2c17372e2f8824778941dbc26bc468d11590329a;hp=7acb488f5cedc6e43b074e68523e80d070f8774f;hpb=22dd2b977af2cdfce6ab5f19e7f8a3ef0f273d82;p=modules%2Fsmesh.git diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 7acb488f5..a7ddf4191 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -823,6 +823,7 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen): # @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 # # Example of Filters usage @@ -1353,7 +1354,10 @@ class Mesh: 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 @@ -2856,7 +2860,6 @@ class Mesh: 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 @@ -2887,6 +2890,20 @@ class Mesh: 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. @@ -3149,6 +3166,8 @@ class Mesh: # @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: @@ -3156,6 +3175,9 @@ class Mesh: 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