Salome HOME
PAL15148(0D Algorithm "Segments around vertex" works wrong)
authoreap <eap@opencascade.com>
Wed, 7 Mar 2007 07:31:47 +0000 (07:31 +0000)
committereap <eap@opencascade.com>
Wed, 7 Mar 2007 07:31:47 +0000 (07:31 +0000)
src/SMESH_SWIG/smesh.py

index db7ac29f64dff66428f314d2a52fdfa1ab75dcbb..1f84436fbff2d2acbe21bc4eb78d1249b5bd33fe 100644 (file)
@@ -541,13 +541,16 @@ class Mesh_Segment(Mesh_Algorithm):
     ## Define "SegmentLengthAroundVertex" hypothesis
     #  @param length for the segment length
     #  @param vertex for the length localization: vertex index [0,1] | verext object
-    def LengthNearVertex(self, length, vertex):
+    def LengthNearVertex(self, length, vertex=0):
         import types
-        if type(vertex) is types.IntType:
-            vertex = geompy.SubShapeAllSorted(self.geom,geompy.ShapeType["VERTEX"])[vertex]
-            pass
         store_geom = self.geom
-        self.geom = vertex
+        if vertex:
+            if type(vertex) is types.IntType:
+                vertex = geompy.SubShapeAllSorted(self.geom,geompy.ShapeType["VERTEX"])[vertex]
+                pass
+            self.geom = vertex
+            pass
+        hyp = self.Hypothesis("SegmentAroundVertex_0D")
         hyp = self.Hypothesis("SegmentLengthAroundVertex")
         self.geom = store_geom
         hyp.SetLength( length )