Issue with DRAWROTATE

Dear,

I just came not to understand the way drawrotate works. The first example states the problem.

When I prescribe a rotation around the Z axis (second example), the X and Y axis seem to swap.

As a result, when I add a rotation around the X axis, the model does rotate, but around the Y axis (third example).

If I add a rotation around the Y axis, the model does rotate, but around the X-axis (fourth example), in inverse trigonometric direction.

As a result, I am not so sure where to put the Center of Gravity of the floatings...

Do someone has the same issue ?


<geometry>

   <drawfilestl file="TF10_Assembly.stl">

      <drawscale x="0.001" y="0.001" z="0.001" />

                         <drawmove x="0" y="0.0" z="0.0" />

      <drawrotate angx="0" angy="0.0" angz="0.0" />         

<floatings>

            <floating mkbound="20">

      <massbody value="1633" />          

      <center x="4.604" y="0.00" z="1.426" />



<geometry>

   <drawfilestl file="TF10_Assembly.stl">

      <drawscale x="0.001" y="0.001" z="0.001" />

                         <drawmove x="0" y="0.0" z="0.0" />

      <drawrotate angx="0" angy="0.0" angz="90.0" />         

<floatings>

            <floating mkbound="20">

      <massbody value="1633" />          

      <center x="0.0" y="4.604" z="1.426" />


<geometry>

   <drawfilestl file="TF10_Assembly.stl">

      <drawscale x="0.001" y="0.001" z="0.001" />

                         <drawmove x="0" y="0.0" z="0.0" />

      <drawrotate angx="20.0" angy="0.0" angz="90.0" />         

<floatings>

            <floating mkbound="20">

      <massbody value="1633" />          

      <center x="0.0" y="3.8386" z="2.9146" />


<geometry>

   <drawfilestl file="TF10_Assembly.stl">

      <drawscale x="0.001" y="0.001" z="0.001" />

                         <drawmove x="0" y="0.0" z="0.0" />

      <drawrotate angx="0.0" angy="20.0" angz="90.0" />         

<floatings>

            <floating mkbound="20">

      <massbody value="1633" />          

      <center x="0.0" y="3.8386" z="2.9146" />



Comments

  • Hello,

    Angle rotation are applied in a certain order (X, Y then Z) !

    I see you are using Blender, the axis referential in Blender is not a"scientific" one (not direct), so angle can have different signs.

    Best Regards

  • Dear,

    In fact, Euler's transformation are no conformal, and I was so used to make my transformation Z, Y,X order. Thanks 🙏.

  • Please use the transformations applied in PARAVIEW first, since those are the same we used in our XML file

    Regards

  • Thank you Alex, with your help, I manage to initiate my xml entry card with a transformation of the importated model, as a combinaison of drawmove and drawrotate :

    <drawfilestl file="TF10_Assembly.stl">

             <drawscale x="0.001" y="0.001" z="0.001" />

                           <drawmove x="-5.0" y="1.6961358168190843e-16" z="2.77" />

             <drawrotate angx="180.0" angy="0" angz="0" />   

    That allow me to keep my center of gravity at the same place.

    <floatings>

               <floating mkbound="20">

          <massbody value="1829" />          

          <center x="-0.492" y="0.0" z="1.385" />

    Providing that angx and angy are related to drawmove_x,drawmove_y,drawmove_y by conventional transformations (I do not treat rotation along Z axis) :

    drawrotate.set('angx',str(heel))

    drawrotate.set('angy',str(trim))

    drawrotate.set('angz',str(0))

    drawmove.set('x',str(Gxp-xp))

    drawmove.set('y',str(Gyp-yp))

    drawmove.set('z',str(Gzp-zp))


    with :


    Gxp = "X position of the gravity center on the vtk importated model"

    Gyp = "Y position of the gravity center..."

    Gzp = "Z position of the gravity center..."

    x1 = Gxp

    y1 = Gyp*np.cos(math.radians(heel))-Gzp*np.sin(math.radians(heel))

    z1 = Gyp*np.sin(math.radians(heel))+Gzp*np.cos(math.radians(heel))

    xp = x1*np.cos(math.radians(trim))-z1*np.sin(math.radians(trim))

    yp = y1

    zp = x1*np.sin(math.radians(trim))+z1*np.cos(math.radians(trim))

    xp = "X position of the gravity center on the DSP model after transformations"

    yp = "Y position of the gravity center..."

    zp = "Z position of the gravity center..."

  • That works well. It allows me to study hydrostatics of floating bodies with your code. And now have a big question regarding this subject !!


    where I simulate a static stability experiment using DSP. Please follow the post if interested.

    regards,

Sign In or Register to comment.