Home Forums Nazca Importing a GDS file prepared by another software Reply To: Importing a GDS file prepared by another software

#4220
Ronald
Keymaster

Hi layouteng,

Yes this is possible with the load_gds method.
In short:

cellA = nd.load_gds(filename='library.gds', cellname='A')
cellA.put(0, 20, 20, flip=True)

A more extended copy-paste example:

import nazca as nd

# Create a GDS library to use in the load_gds example:
with nd.Cell('A') as A:
    nd.Polygon(points=[(0, 0), (10, 0), (0, 5)]).put(0)
with nd.Cell('B') as B:
    nd.Polygon(points=[(0, 0), (-5, 5), (0, 1)]).put(0)
nd.export_gds([A, B], filename='library')

# and the actual load_gds example:
cellA = nd.load_gds(filename='library.gds', cellname='A')
cellB = nd.load_gds(filename='library.gds', cellname='B', scale=5.0)

cellA.put(0)
cellA.put(10, 20, 45)
cellB.put(20, flip=True)
cellB.put(20, flop=True)

nd.export_gds(filename='use_a_gds_library')

See the load_gds docstring for more options.

Ronald