Cant figure out how to add a rotation of say 90 degrees to this code

Here is the code that (Ruby) where is places the box is a location but I would also like to rotate also.


tlcdox = (((nydy)/2)-768500)-1 # -9766500 #location of BLCD in Y
tlcdoy = (((nx*dx)/2)-240000.5) # 10294500 #location of BLCD in X
tlcdtrans = RBA::Trans::new(RBA::Point::new(tlcdox, tlcdoy))
array.insert(RBA::CellInstArray::new(blcd_cell_index, tlcdtrans, ax2, ay2, blcdnx, blcdny))


  • One way to achieving this is the following transformation (here: 90 degree counterclockwise):

    tlcdtrans = RBA::Trans::new(RBA::Trans::R90, RBA::Vector::new(tlcdox, tlcdoy))

    or short:

    tlcdtrans = RBA::Trans::new(RBA::Trans::R90, tlcdox, tlcdoy)


  • Thanks for the help Mattias this helped. I know with was easy for you but I couldn't get past the syntex

Sign In or Register to comment.