]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[PythonAPI] Fix fillet constraint to match the new interface
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 16 Dec 2015 08:40:35 +0000 (11:40 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Thu, 17 Dec 2015 11:53:07 +0000 (14:53 +0300)
src/PythonAPI/model/sketcher/sketch.py

index 0ba028e64572fd54a5b237158b9f90debfaac00a..9a5c3c78460c73e0babce35307f4b9381bb81b08 100644 (file)
@@ -308,13 +308,20 @@ class Sketch(Interface):
         self.execute()
         return constraint
 
-    def setFillet(self, line_1, line_2, radius):
+    def setFillet(self, *args):
         """Set a fillet constraint between the 2 given lines with the given
         filleting radius."""
+        assert(args)
         constraint = self._feature.addFeature("SketchConstraintFillet")
-        constraint.data().refattr("ConstraintEntityA").setObject(line_1)
-        constraint.data().reflist("ConstraintEntityB").clear()
-        constraint.data().reflist("ConstraintEntityB").append(line_2)
+        if len(args) == 3:
+            line_1, line_2, radius = args
+            constraint.data().refattr("ConstraintEntityA").setObject(line_1)
+            constraint.data().reflist("ConstraintEntityB").clear()
+            constraint.data().reflist("ConstraintEntityB").append(line_2)
+        elif len(args) == 2:
+            point, radius = args
+            self._fillAttribute(constraint.refattr("ConstraintEntityA"), point)
+            self._fillAttribute(constraint.real("ConstraintValue"), radius)
         self.execute()
         return constraint