Can't rotate cell instance with angle, only constant?

I have a Python script which generates a layout and some of the cells are placed at 90, 180, and 270 degree rotations.

This code will place the cell at a 270 degree angle:

idx = _0201_BOT_rect10_63x14_567.cell_index()
inst = pya.CellInstArray(idx, pya.Trans(3, False, pya.Point(-2540000, 2040000)))

This code will not:

idx = _0201_BOT_rect10_63x14_567.cell_index()
inst = pya.CellInstArray(idx, pya.Trans(270, False, pya.Point(-2540000, 2040000)))

What do I need to do to use the angle instead of the constant? I am using 0.26.6 on RHEL7.

Looking at the documentation, I see this signature:

new Trans ptr new (int rot,
bool mirr,
int x,
int y) Creates a transformation using angle and mirror flag and two coordinate values for displacement

Is this only supported in Ruby?


  • edited June 15


    the documentation also says:

    rot: The rotation in units of 90 degree

    So 0 = 0°, 1 = 90°, 2 = 180°, 3 = 270°. Beside "Trans" there is also "CplxTrans" (more specifically "ICplxTrans") which supports any-angle rotations. But those are discouraged in some applications because they lead to off-grid shapes and other nasty effects.


Sign In or Register to comment.