Home Forums Nazca quasi-curved polygon!

Tagged:

Viewing 3 posts - 1 through 3 (of 3 total)
• Author
Posts
• #5338
sara
Participant

Hello,

I want to form a polygon with the shape of the picture attached. two edges of the shape is a designed curved and I want to define the polygon based on the pins of those curves and using normal positions for the straight line.

Here is my questions:

1- How to put ‘pin’ inside argument of polygon? (something like this:

`nd.Polygon(layer=10, points=[(curve1.pin['a0']), (curve2.pin['a0']), (0.0, -1.0), (0.0, 1.0)]))`

2- and yet even if I succeed putting pin inside polygon the final shape is not want I intended to have (it will be a filled rectangular), so I need to know is there any way to draw a polygon like the picture?

*If the attachment does not work, this is the link to the picture:

View post on imgur.com

#5345
Xaveer
Moderator

Hi Sara,

If you need a polygon with a hole in GDS, you need to do something like shown in the figure:

You cannot add pins to a polygon, but you can put the polygon in a cell and add pins to the cell. Just have a look at the Nazca tutorial: create-bb-using-polygon

That should work.

Xaveer

#5347
Ronald
Keymaster

Dear sara,

The pins are more useful in the context of connecting building blocks, rather than defining polygon structures.

To answer the polygon part if for some reason you want to use pins:

1.
The point keyword in Polygon accepts a list of (x, y) describing the polygon points in order as drawn.

Note that curve.pin[‘a0’] does not describe the curve. It is a point (pin) to reference a position with respect to the curve. If you want to use a pin position in a polygon (unlikely), use the pin’s xya method:

``````import nazca as nd

p1 = nd.Pin('a0').put(10, 20, 30)
x1, y1, a1 = p1.xya()

x2, y2, a2 = nd.Pin('b0').put(10, -20, -30).xya()

nd.Polygon(points=[(0,0), (x1, y1), (x2, y2)], layer=1)``````

2.
You need to create a polygon that “carves-out” the desired shape along the outline of the blue structure in your picture. See the next example, and note that the “filled” structure is on the “left side” of the line that defines the polygon. Orientation of the outline matters.

``````import nazca as nd

points = [(-1, 1), (1, 1), (1, -1), (-1, -1), (-1, 1), (-2, -2), (2, -2), (2, 2), (-2, 2), (-2, -2)]
nd.Polygon(points=points).put(0)
nd.export_plt()``````

Ronald

Viewing 3 posts - 1 through 3 (of 3 total)
• You must be logged in to reply to this topic.