NPAL 12483 Translate an object given a vector and a length

This commit is contained in:
dmv 2008-03-11 13:36:55 +00:00
parent be244d874f
commit 86019a6c24
2 changed files with 15 additions and 0 deletions

View File

@ -171,6 +171,7 @@ def TestAll (geompy, math):
#Transform objects #Transform objects
Translation = geompy.MakeTranslationTwoPoints(Box, px, pz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr 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 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 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 RotatPnt = geompy.MakeRotationThreePoints(Box, px, py, pz) #(4 GEOM_Object_ptr)->GEOM_Object_ptr
Scale = geompy.MakeScaleTransform(Box, p0, factor) # Scale = geompy.MakeScaleTransform(Box, p0, factor) #
@ -315,6 +316,7 @@ def TestAll (geompy, math):
id_Translation = geompy.addToStudy(Translation, "Translation") id_Translation = geompy.addToStudy(Translation, "Translation")
id_TranslVect = geompy.addToStudy(TranslVect , "Translation along vector") 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_Rotation = geompy.addToStudy(Rotation, "Rotation")
id_RotatPnt = geompy.addToStudy(RotatPnt, "Rotation by three points") id_RotatPnt = geompy.addToStudy(RotatPnt, "Rotation by three points")
id_Scale = geompy.addToStudy(Scale, "Scale") id_Scale = geompy.addToStudy(Scale, "Scale")

View File

@ -1615,6 +1615,19 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("TranslateVectorCopy", self.TrsfOp) RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
return anObj 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 ## Rotate the given object around the given axis
# on the given angle, creating its copy before the rotatation. # on the given angle, creating its copy before the rotatation.
# @param theObject The object to be rotated. # @param theObject The object to be rotated.