Grasshopper

algorithmic modeling for Rhino

when i print a transformation like:

dim blah as transform = transform.translation(1,2,3)

print("move")

print(blah.tostring)

 

I get a result that looks like this:

 

move

R0=(1,0,0,1), R1=(0,1,0,2), R2=(0,0,1,3), R3=(0,0,0,1)

 

I understand that:

the x value is the 1st in R0

the y value is the 2nd in R1

the z value is the 3rd in R2

 

I have no idea what R3 is or why I need it.

I have no idea why there are 4 values each time when i only input 3

 

The next question is how do I take this data and make it print

move

(X=1, Y=2, Z=3)

 

Thanks

 

 

Views: 249

Replies to This Discussion

Hi Andy,

Transform in rhino produces a 4x4 (4rows by 4columns) transformation matrix where R0 is row 0, R2 row 2 and so on.

Have a look at "essential mathematics for computational design" by Rajaa Isaa where this is explained.

I hope this helps!

Evert

This is actually exactly what I needed. Thanks for heads up.

Using Evert Amador's advice I read the book and camp up with the solution

 

 

print("move ")

      print("[X = " & blah.M03 & ", Y = " & blah.M13 & ", Z = " & blah.M23 & "]")

 

 results in:


move

[X = 1, Y = 2, Z = 3]

 

Thanks!

 

 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service