]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
NPAL 12483 Translate an object given a vector and a length
authordmv <dmv@opencascade.com>
Tue, 11 Mar 2008 13:36:55 +0000 (13:36 +0000)
committerdmv <dmv@opencascade.com>
Tue, 11 Mar 2008 13:36:55 +0000 (13:36 +0000)
src/GEOM_SWIG/GEOM_TestAll.py
src/GEOM_SWIG/geompyDC.py

index 4c2d3675aa55891043393d4f62a7f57c5b76746c..07ed3e95d38fcb4bfd57f24138db078992315bbb 100644 (file)
@@ -171,6 +171,7 @@ def TestAll (geompy, math):
   #Transform objects
   Translation = geompy.MakeTranslationTwoPoints(Box, px, pz)    #(3 GEOM_Object_ptr)->GEOM_Object_ptr
   TranslVect  = geompy.MakeTranslationVector(Box, vxyz)         #(2 GEOM_Object_ptr)->GEOM_Object_ptr
+  TranslVectD = geompy.MakeTranslationVectorDistance(Box, vxyz, 50.0)   #(2 GEOM_Object_ptr)->GEOM_Object_ptr  
   Rotation    = geompy.MakeRotation(Box, vz, angle1)            #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
   RotatPnt    = geompy.MakeRotationThreePoints(Box, px, py, pz) #(4 GEOM_Object_ptr)->GEOM_Object_ptr
   Scale       = geompy.MakeScaleTransform(Box, p0, factor)      #
@@ -315,6 +316,7 @@ def TestAll (geompy, math):
 
   id_Translation = geompy.addToStudy(Translation, "Translation")
   id_TranslVect  = geompy.addToStudy(TranslVect , "Translation along vector")
+  id_TranslVectD = geompy.addToStudy(TranslVectD, "Translation along vector with defined distance")
   id_Rotation    = geompy.addToStudy(Rotation,    "Rotation")
   id_RotatPnt    = geompy.addToStudy(RotatPnt,    "Rotation by three points")
   id_Scale       = geompy.addToStudy(Scale,       "Scale")
index 5853af96666764107117bf8f5701a78a189606c0..cfd7fdb20b9084abff374711a9b53626df01aadf 100644 (file)
@@ -1615,6 +1615,19 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
             return anObj
 
+        ## Translate the given object along the given vector on given distance,
+        #  creating its copy before the translation.
+        #  @param theObject The object to be translated.
+        #  @param theVector The translation vector.
+        #  @param theDistance The translation distance.
+        #  @return New GEOM_Object, containing the translated object.
+        #
+        #  Example: see GEOM_TestAll.py
+        def MakeTranslationVectorDistance(self,theObject, theVector, theDistance):
+            anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
+            RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
+            return anObj
+        
         ## Rotate the given object around the given axis
         #  on the given angle, creating its copy before the rotatation.
         #  @param theObject The object to be rotated.