Home Forums Nazca Questions and Answers Circular array of a cell from a gds file – how to do it? Reply To: Circular array of a cell from a gds file – how to do it?

#6108
Ronald
Keymaster

Dear Cameron,

Only place the cells that are < radius from a center (x0, y0):

from math import sqrt
import nazca as nd

cell = nd.load_gds(filename="my.gds", cellname="my_cell_name")

with nd.Cell('circle') as C:
    N = 50
    M = 50
    dx = 40
    dy = 70
    x0 = 1000
    y0 = 1000
    radius = 1000
    for n in range(N):
        for m in range(M):
            x = dx*n
            y = dy*m
            if (x-x0)**2 + (y-y0)**2 < radius**2:
                cell.put(x, y, 0)

C.put()
nd.export_gds()

Ronald