Home › Forums › Nazca › Questions and Answers › Circular array of a cell from a gds file – how to do it?
Tagged: import, instance, array, array shape
- This topic has 4 replies, 2 voices, and was last updated 4 years, 6 months ago by Cameron.
-
AuthorPosts
-
21 April 2020 at 22:41 #6103CameronMember
I have created a cell in a separate layout software. The cell is a small object which needs to be arrayed, however my software only allows me to create square-shaped arrays. What I’d like to do is create a circular array of instances of my existing cell.
So I’d like to first import my gds file which contains only the cell and the object of interest, and instance the cell therein into an array with an overall circular shape. It would be great if I could specify the total number of devices (and their spacing) to define the diameter of the circle, then the Nazca script would fill in the circle with as many complete instances of the object as will fit into that circle.
Thank you in advance!
21 April 2020 at 22:54 #6105RonaldKeymasterDear Cameron,
GDS natively supports arrays on cell instances that span two vectors (dx1, dy1) and (dx2, dy2), not circles. For a circular array you have to place cells simply on a circle.
from math import sin, cos, pi import nazca as nd cell = nd.load_gds(filename="my.gds", cellname="my_cell_name") with nd.Cell('circle') as C: N = 20 radius = 500 for i in range(N): cell.put(radius*cos(i*2*pi/N), radius*sin(i*2*pi/N), 0) C.put() nd.export_gds()
For a native cell array check out the gds arrays tutorial.
Ronald
21 April 2020 at 22:56 #6106CameronMemberJust to clarify: I mean the elements in the array can be spaced equally in x and y directions from each other (i.e., it is a square array in that sense), however the bounds of the array (i.e., the length of any row or height of any column in the array) is defined by a circular shape. So a row across the center will have devices filling the diameter of the cirlce but a row near the edge of circule will be few or even just one device. So the whole array fills in circular area, although the spacing of devices is a simple fixed distance in x and y directions from each other.
Thanks!
21 April 2020 at 23:11 #6108RonaldKeymasterDear 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
21 April 2020 at 23:25 #6109CameronMemberThank you a bunch Ronald, this is great! I have another question about wiring, but to keep the forum organized I’ll create a new topic.
-
AuthorPosts
- You must be logged in to reply to this topic.