Grasshopper

algorithmic modeling for Rhino

Hello all you users that are smarter than I,

I am trying to calculate the rotational values that describe a plane.  

Grasshopper usually displays the XYZ coordinates along with the Z vector's XYZ to describe a plane in the world.  What I need is to figure out is what the rotations around each of the world's vectors would be to describe a given plane.  In other words, I need the ABC rotations around the world XYZ vectors.  This way, any plane in the world could be described by their XYZ positions with their ABC orientation.

I made a quick stab at finding these numbers, and I know there must be a more straight forward calculation.

I could not find the first rotation around any of the vectors without intersecting geometry, in this case two circles. This gives me my first angle C around the plane's Z vector which allows me to rotate the plane so that its X vector is parallel to the world plane.  I can then use more typical calculations to find B rotation around Y to alight the planes X with the world X, and finally the rotation A around the plane's X vector that makes the planes match up.  If I multiply the ABC values I found, I think they give me the rotations that I am looking for.  

Yes, this is working, but I was wondering if there is a more direct process for calculating ABC rotations.

Thank you for bearing with me.  Any comments or questions will be happily received and addressed.

Views: 4883

Attachments:

Replies to This Discussion

Sounds like you are working with Tait-Bryan angles 

and here's the direct way of calculating them from the transformation matrix

Attachments:

Awesome! I never knew how to use the transformation data... I was briefly trying to figure out what to do with it.  I will invest some more time into understanding that output.

Thank you for the script.  I was hoping to write a definition that would run fast, and now that you provided one in C#, fast it shall run.

Kind Regards,

Jake

Glad to help. If you want to understand more there's a nice explanation of the relation between Yaw-Pitch-Roll angles and transformation matrices here: http://planning.cs.uiuc.edu/node102.html

By the way, what's the application? 

I am working on a new output process for driving the robots in SCI_Arc's Robotics Lab.  We are working on real time projects, and I should be able to calculate robot positions much faster with planes rather than with joint rotations. 

Thank you for the links and all the information.  If you want to know more about the projects, let me know.

Kind Regards,

Jake

Hi Daniel,

I am revisiting this old topic and am having some troubles getting the correct rotations from the transformation matrix. 

When using the YawPitchRoll script, what is the order of the rotations that are output?

I am trying to get the rotations in the order of X', Y'', Z''' (Rx first, Ry second, Rz last) moving from the fixed reference plane to the variable target plane.

Also, is the YawPitchRoll equation susceptible to singularities? At times, when I use the component, I do not get rotations around the Y or Z axis. I am assuming that the solution can not be determined because of a singularity around one or more axis. Is there a way around this problem other than avoiding certain orientations?

Thank you for the insight! I have played around with various equations that I have found online, but I do not seem to be getting the correct order of rotations.

Kind regards,

Jake

Hi Daniel,

Sorry to bother, but I found out why my rotations were not working. 

The method that you provided does each rotation around the initial reference vectors sequentially. Thus, plane(x,y,z) is rotated first around reference x giving plane(x',y',z'), then is rotated around reference y giving plane(x'',y'',z'') and finally rotated around reference z giving the resulting plane(x''',y''',z'''). 

The method that I am looking for rotates the plane around each resulting vector from the previous rotation. Thus, plane(x,y,z) is rotated around reference x giving plane(x',y',z'), then is rotated around its new y' vector giving plane(x'',y'',z'') and finally rotated around its new z'' vector giving plane(x''',y''',z''').

Now that I know the difference, I will try to find the right matrix to get this sequence of transformations. I know a way of doing multiple transformations to get these values, but I don't now a nice equations to give these values from the original transformation.

Thank you for the help! I will post a solution when I have proven one is working.

Kind regards,

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service