Personal tools
You are here: Home Forum Use strange Behavior with MakeRotation on a box object

strange Behavior with MakeRotation on a box object

Up to Use
  • strange Behavior with MakeRotation on a box object

    Posted by Bonaccorsi at November 17. 2006
    Hello,

    I found MakeRotation have a strange behavior :

    In GUI mode i build a box with 2 vertex and a vector with dx,dy and dz. Then i make a rotation of this box around this vector with an angle. It's Ok.

    Now, i want to do the same operation in a PYTHON script. I build the box with MakeBoxTwoPnt, I build the vector with MakeVectorDXDYDZ and rotate with "box = MakeRotation(box,vector,angle)". Then I add box to the study and the result is not similar to GUI mode. I also tried with angle = 0, the box is rotate and I don't understand why.

    Is it a bug ?

    Thanks,

    Thomas.
    • Re: strange Behavior with MakeRotation on a box object

      Posted by Kloss Francis at November 17. 2006
      See next the python script write from your message,
      this script run with no bug and a good behavior.
           Is the next script conform with your pb. ?
           Is not, send me your script ?

      Francis KLOSS

      from geompy import *

      point_1 = MakeVertex(10, 20, 30)

      point_2 = MakeVertex(100, 200, 300)

      box_1 = MakeBoxTwoPnt(point_1, point_2)

      axis = MakeVectorDXDYDZ(1, 2, 4)

      box_2 = MakeRotation(box_1, axis, 0.32)

      addToStudy(box_1, "box_1";)
      addToStudy(box_2, "box_2";)
      • Re: strange Behavior with MakeRotation on a box object

        Posted by Christophe Bourcier at November 17. 2006
        Well, in the GUI, angles are expressed in degrees, while in python scripts, they have to be expressed in radians.

        This can explain different results from GUI to TUI, but not when angle = 0.

        Try to dump your study to compare the generated script and the one you wrote.

        Cheers.

        Christophe
        • Re: strange Behavior with MakeRotation on a box object

          Posted by Bonaccorsi at November 20. 2006
          It's ok,

          I work with XDATA objects and in my script there was two calls to "box = MakeRotation(box,axis,angle)" ...

          Sorry,

          Thomas.
Powered by Ploneboard
Document Actions