Salome HOME
Merge from V6_main 13/12/2012
[modules/geom.git] / src / GEOM_SWIG / gsketcher.py
index 11cb0771ca0cad3f332b2ced31d8b77dede33c7d..11ef9bb6d6f183b00046a1fdf7bcf5fdac2013e7 100644 (file)
@@ -121,28 +121,121 @@ class Sketcher3D:
     ## Add one straight segment, defined by two angles and length.
     #  If the first point of sketcher is not yet defined, the
     #  origin (0, 0, 0) will become the first sketcher point.
-    #  @param axes can be: "OXY", "OYZ" or "OXZ"
+    #  The radius and angles coordinates are defined 
+    #  in a local coordinate system which origin is the last point of the sketch
+    #
+    #  @param length length of the segment
     #  @param angle1 angle in a plane, defined by the \a axes
     #  @param angle2 angle from the plane, defined by the \a axes
-    #  @param length length of the segment
-    def addPointAnglesLength (self, axes, angle1, angle2, length):
+    #  @param axes can be: "OXY", "OYZ" or "OXZ"
+    def addPointRadiusAnglesRelative (self, length, angle1, angle2, axes="OXY"):
         """
         Add one straight segment, defined by two angles and length.
         If the first point of sketcher is not yet defined, the
         origin (0, 0, 0) will become the first sketcher point.
 
         Parameters:
+            length length of the segment
+            angle1 angle in a plane, defined by the \a axes
+            angle2 angle from the plane, defined by the \a axes
             axes can be: "OXY", "OYZ" or "OXZ"
+
+        Example of usage:
+            sk = geompy.Sketcher3D()
+            sk.addPointRadiusAnglesRelative(100, 50, 0, "OXY")
+            a3D_Sketcher_1 = sk.wire()
+        """
+        self.myCommand = self.myCommand + ":%s"%axes+"SR"+" %s %s %s" % (printVar(angle1), printVar(angle2), printVar(length))
+        pass
+    
+    ## Add one straight segment, defined by two angles and radius.
+    #  If the first point of sketcher is not yet defined, the
+    #  origin (0, 0, 0) will become the first sketcher point.
+    #  The radius and angles coordinates are defined 
+    #  in a coordinate system which origin is the global coordinate system origin
+    #  
+    #  @param radius distance to the coordinate system origin
+    #  @param angle1 angle in a plane, defined by the \a axes
+    #  @param angle2 angle from the plane, defined by the \a axes
+    #  @param axes can be: "OXY", "OYZ" or "OXZ"
+    def addPointRadiusAnglesAbsolute (self, radius, angle1, angle2, axes="OXY"):
+        """
+        Add one straight segment, defined by two angles and length.
+        If the first point of sketcher is not yet defined, the
+        origin (0, 0, 0) will become the first sketcher point.
+
+        Parameters:
+            radius distance to the coordinate system origin
             angle1 angle in a plane, defined by the \a axes
             angle2 angle from the plane, defined by the \a axes
-            length length of the segment
+            axes can be: "OXY", "OYZ" or "OXZ"
+
+        Example of usage:
+            sk = geompy.Sketcher3D()
+            sk.addPointRadiusAnglesAbsolute(100, 50, 0, "OXY")
+            a3D_Sketcher_1 = sk.wire()
+        """
+        self.myCommand = self.myCommand + ":%s"%axes+"SA"+" %s %s %s" % (printVar(angle1), printVar(angle2), printVar(radius))
+        pass
+    
+    ## Add one straight segment, defined by an angle, a height and a radius.
+    #  If the first point of sketcher is not yet defined, the
+    #  origin (0, 0, 0) will become the first sketcher point.
+    #  The radius height and angle coordinates are defined 
+    #  in a local coordinate system which origin is the last point of the sketch
+    #  
+    #  @param axes can be: "OXY", "OYZ" or "OXZ"
+    #  @param angle angle in a plane, defined by the \a axes
+    #  @param height height from the plane, defined by the \a axes
+    #  @param radius distance to the coordinate system origin
+    def addPointRadiusAngleHRelative (self, length, angle, height, axes="OXY"):
+        """
+        Add one straight segment, defined by two angles and length.
+        If the first point of sketcher is not yet defined, the
+        origin (0, 0, 0) will become the first sketcher point.
+
+        Parameters:
+            radius distance to the coordinate system origin
+            angle  angle in a plane, defined by the \a axes
+            height height from the plane, defined by the \a axes
+            axes can be: "OXY", "OYZ" or "OXZ"
+
+        Example of usage:
+            sk = geompy.Sketcher3D()
+            sk.addPointRadiusAngleHRelative(100, 50, 40, "OXY")
+            a3D_Sketcher_1 = sk.wire()
+        """
+        self.myCommand = self.myCommand + ":%s"%axes+"CR"+" %s %s %s" % (printVar(angle), printVar(height), printVar(length))
+        pass
+    
+    ## Add one straight segment, defined by an angle, a height and a radius.
+    #  If the first point of sketcher is not yet defined, the
+    #  origin (0, 0, 0) will become the first sketcher point.
+    #  The radius height and angle coordinates are defined 
+    #  in a coordinate system which origin is the global coordinate system origin
+    # 
+    #  @param radius distance to the coordinate system origin
+    #  @param angle angle in a plane, defined by the \a axes
+    #  @param height height from the plane, defined by the \a axes
+    #  @param axes can be: "OXY", "OYZ" or "OXZ"
+    def addPointRadiusAngleHAbsolute (self, radius, angle, height, axes="OXY"):
+        """
+        Add one straight segment, defined by two angles and length.
+        If the first point of sketcher is not yet defined, the
+        origin (0, 0, 0) will become the first sketcher point.
+
+        Parameters:
+            axes can be: "OXY", "OYZ" or "OXZ"
+            angle1 angle in a plane, defined by the \a axes
+            height height from the plane, defined by the \a axes
+            radius distance to the coordinate system origin
 
         Example of usage:
             sk = geompy.Sketcher3D()
-            sk.addPointAnglesLength("OXY", 50, 0, 100)
+            sk.addPointRadiusAngleHAbsolute( 100, 50, 40, "OXY")
             a3D_Sketcher_1 = sk.wire()
         """
-        self.myCommand = self.myCommand + ":%s %s %s %s" % (axes, printVar(angle1), printVar(angle2), printVar(length))
+        self.myCommand = self.myCommand + ":%s"%axes+"CA"+" %s %s %s" % (printVar(angle), printVar(height), printVar(radius))
         pass
 
     ## Set to close the wire