Common used transformation
Transformation functions are useful when one needs to move or mirror the instance(PCells) to other places. These functions can be used for the PCells multiple times and combine them together.
place
This function is often used when one needs to place an instance(PCell) to a place where refers to another instance’s position. Let’s say there are two devices(
device_A(bend),device_B(straight)) and we wish to move thedevice_Ato a specific place where related to the position ofdevice_B.
new_device_A = fp.place(device_A, “port_A”, at=device_B[”port_B”])In this method, the two ports will be connected.
new_device_A = fp.place(device_A, “port_A”, at=device_B[”port_B”].position)In this method,
port_Awill be placing at the position ofport_Bbut remaining the port orientation.
new_device_A = fp.place(device_A, “port_A”, at=device_B[”port_B”]).translated(x, y)In this method,
port_Awill first be aligned toport_Band move to(x, y)related toport_B.
new_device_A = fp.place(device_A, “port_A”, at=device_B[”port_B”].rotated(degrees=-90))In this method,
port_Awill be connected toport_Bwith an angle difference of 90 degrees.
translated
Usage: insts.translated()
parameters: tx, ty
DirectionalCouplerBend().translated(10, 10): origin of the cell is translated to (10, 10).The origin of the cell can be defined in the PCell
scaled
Usage: insts.scaled()
parameters: sx, sy
DirectionalCouplerBend().scaled(3): the cell is magnified both x and y coordinate to three times larger than origin.DirectionalCouplerBend().scaled(3, 2): the cell is magnified to three time larger on the x-axis and two times larger on the y-axis than origin.
rotated
Usage: insts.rotated()
parameters: degrees, radians, origin
DirectionalCouplerBend().rotated(degrees=90): the cell rotated 90 degree based on the origin of the cell.
mirrored
Usage: insts.*_mirrored()
c_mirrored(): mirroring the cell with regard to the origin (0, 0).
v_mirrored(): mirroring the cell with regard to the y-axis.
h_mirrored(): mirroring the cell with regard to the x-axis.