Home › Forums › Nazca › Get global pin coordinates › Reply To: Get global pin coordinates
21 October 2021 at 20:40
#6612
Keymaster
Dear Dominik,
The cell_iter() can be of help. It can locate all elements in a celltree with respect to a topcell.
Place this before nd.export_gds():
for params in nd.cell_iter(cell_top):
if params.cell_start: # check if we are on a cell_open pass (or check for a cell_close).
if params.cell.cell_name == "Device": # check if we are in the right cell
pointer, flip = params.transflip_glob # get cell's translation (pointer) and flip w.r.t. cell_top
for name, pin in params.cell.pin.items(): # print all pin names and locations
print(name, pointer.copy().move_ptr(pin.pointer))) # add pin position in the cell to the cell translation.
# output:
org Pointer: (x = 0.00, y = 20.00, a = 0.00°)
gc1 Pointer: (x = 0.00, y = 20.00, a = 180.00°)
gc2 Pointer: (x = 100.00, y = 20.00, a = 180.00°)
a0 Pointer: (x = 0.00, y = 20.00, a = 360.00°)
b0 Pointer: (x = 0.00, y = 20.00, a = 360.00°)
The .copy() is needed to not change the original pointer with the .move_ptr().
The ‘org’ pin is always created as cell origin.
The ‘a0’ and ‘b0’ pins are default Nazca pins. You can get rid of those using cell_device.default_pins(‘gc1’, ‘gc2’) inside the cell_device cell definition.
Ronald