Dear all,
I would like to rotate a shape by script.
For example,
I use this following script can create a shape:
startx = ring_centerx - rbendring # The x coordination of grating waveguide
starty = ring_centery # The y coordination of grating waveguide
wg_left = RBA::Box::new_lbrt( startx - w_o * 0.5, starty , startx - w_o * 0.5 - etchw, starty + wglen2)
topcell.shapes( layer_id2 ).insert_box( wg_left )
wg_right = RBA::Box::new_lbrt( startx + w_o * 0.5, starty , startx + w_o * 0.5 + etchw, starty + wglen2)
topcell.shapes( layer_id2 ).insert_box( wg_right )
How can I rotate the shape by 15 degree by ruby script?
Thank you very much.
Aaron
Comments
Hi Aaron,
you'd like to rotate the box before you insert it?
Well, the solution is to use a polygon (a box won't rotate by an arbitrary angle) and to use a transformation:
Matthias
This is exactly what I want. But I still have another question.
The rotation corresponds to the origin (0,0), right?
How can I move the shape before I insert it?
Thank you very much~
Aaron
Hi Aaron,
the displacement is the forth parameter of the ICplxTrans constructor. The other parameters are: magnification, rotation angle, mirror flag.
The operations are applied in that order: magnification, mirror (at x axis), rotation and finally displacement.
Matthias