From: eap Date: Wed, 17 Feb 2010 14:54:30 +0000 (+0000) Subject: 1) X-Git-Tag: V5_1_4a1~79 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=db9b76d34255181d92228a5472069285ce191165;p=modules%2Fsmesh.git 1) + ## Defines "QuadrangleParams" hypothesis + # @param vertex: vertex of a trilateral geometrical face, around which triangles + # will be created while other elements will be quadrangles. + # Vertex can be either a GEOM_Object or a vertex ID within the + # shape to mesh + # + def TriangleVertex(self, vertex, UseExisting=0): 2) in FixedPoints1D(), convert geom reversed edges into IDs --- diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index 66afda3a7..24a76894c 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -3943,10 +3943,13 @@ class Mesh_Segment(Mesh_Algorithm): def FixedPoints1D(self, points, nbSegs=[1], reversedEdges=[], UseExisting=0): if not isinstance(reversedEdges,list): #old version script, before adding reversedEdges reversedEdges, UseExisting = [], reversedEdges + if reversedEdges and isinstance( reversedEdges[0], geompyDC.GEOM._objref_GEOM_Object ): + for i in range( len( reversedEdges )): + reversedEdges[i] = self.mesh.geompyD.GetSubShapeID(self.mesh.geom, reversedEdges[i] ) entry = self.MainShapeEntry() hyp = self.Hypothesis("FixedPoints1D", [points, nbSegs, reversedEdges, entry], UseExisting=UseExisting, - CompareMethod=self.CompareArithmetic1D) + CompareMethod=self.CompareFixedPoints1D) hyp.SetPoints(points) hyp.SetNbSegments(nbSegs) hyp.SetReversedEdges(reversedEdges) @@ -4459,6 +4462,23 @@ class Mesh_Quadrangle(Mesh_Algorithm): CompareMethod=self.CompareEqualHyp) return hyp + ## Defines "QuadrangleParams" hypothesis + # @param vertex: vertex of a trilateral geometrical face, around which triangles + # will be created while other elements will be quadrangles. + # Vertex can be either a GEOM_Object or a vertex ID within the + # shape to mesh + # + # @ingroup l3_hypos_additi + def TriangleVertex(self, vertex, UseExisting=0): + vertexID = vertex + if isinstance( vertexID, geompyDC.GEOM._objref_GEOM_Object ): + vertexID = self.mesh.geompyD.GetSubShapeID( self.mesh.geom, vertex ) + hyp = self.Hypothesis("QuadrangleParams", [vertexID], UseExisting = UseExisting, + CompareMethod=lambda hyp,args: hyp.GetTriaVertex()==args[0]) + hyp.SetTriaVertex( vertexID ) + return hyp + + # Public class: Mesh_Tetrahedron # ------------------------------