Tagged: Bending a straight structure
13 March 2021 at 10:13 #6367
I would be grateful if you could help me with the following questions:
I have structure consists of a box(rectangular) which two tapers are connected to it. I must put this structure on top of a ring resonator where the structure should completely fit in, how can I bend my structure according to the radius of the ring?
Or, if it’s not possible, any suggestions?
Rose13 March 2021 at 10:16 #6369
Would you have a picture of what you like to achieve?
Ronald14 March 2021 at 13:29 #6370
Thank you so much for your prompt reply. Can you please see the picture below.
the picture of a box which has two tapers on both sides and needs to match the arch of a ring resonator
with 100micron radius and 10 micron thickness.
Many thanks in advance for your help.
Rose14 March 2021 at 13:35 #637114 March 2021 at 13:44 #6372
Thank you so much for your prompt reply. Can you please see the picture.
The picture of a box which has two tapers on both sides and needs to match the arch of a ring resonator with 100micron radius and 10 micron thickness.
The whole structure goes on top of the ring resonator and needs to carve around it.
I also attached the codes of my structure to give you a better idea of what I mean.
Many thanks in advance for your help.
Rose15 March 2021 at 22:02 #6373
To make a polygon shape follow an “arbitrary” line would require to transform its polygon from the standard straight coordinate system to one that follows the line. For an arc you can do something like below, where the red shape is the original shape and the blue is wrapped on a circular arc:
from math import sin, cos import nazca as nd def create_taper(): """Create a taper shape as you see fit.""" dh = 1 s = 30 N = 20 points1 =  points2 =  for i in range(N + 1): scale = -0.5 + i / N points1.append((s*scale, dh * (1 - abs(scale)))) points2.append((-s*scale, -dh *(1 - abs(scale)))) return points1 + points2 def bend_polygon(points=None, radius=10): """Bend a polygon along a circular arc.""" pointsout =  # Conformal transformation to a circular grid: for x, y in points: x2 = (radius + y) * sin(x / radius) y2 = (radius + y) * cos(x / radius) pointsout.append((x2, y2)) return pointsout with nd.Cell() as C: radius = 15 points = create_taper() pointsbend = bend_polygon(points=points, radius=radius) nd.Polygon(points=points, layer=1).put(0, radius) nd.Polygon(points=pointsbend, layer=2).put(0) nd.export_png(C)
Ronald17 March 2021 at 15:55 #6374
Thanks for your help.
How can I generate a gds file from your codes?
Whenever I run the codes, It shows nothing?
Rose19 March 2021 at 11:11 #6380
It generates a png as the one shown in the post.
You may need to add a line like
(to poke Matplotlib,
import matplotlob.pyplot as plt)
For gds you can use
Ronald22 March 2021 at 10:14 #6385
Thanks for your response.
I followed all your instructions but my gds file still shows nothing.
It appears empty (no layers and…).
Rose22 March 2021 at 18:12 #6390
If I copy paste the example with nd_export_plt() as provided and run in Spyder it shows the plot in the Spyder plot tab (Spyder4), as expected and shown in the post. If you do not see it, do you see any matplotlib output outside Nazca?
If I copy paste the example and *replace*
nd.export_gds(C)it exports the gds as expected.
Starting layout export... ...gds generation ...Wrote file './nazca_export.gds'
nd_export_plt(C) # the C is needed as cell C is never put() in the example. # alternatively: C.put(0) nd_export_plt() # export the nazca main canvas having C on board.
If you keep both plt and gds output commands you have to check the notes below.
nd_export_plt() # deletes/resets the canvas after export nd_export_gds() # nothing to draw
nd_export_plt(clear=False) # does *not* delete the canvas nd_export_gds() # now generates full gds
- You must be logged in to reply to this topic.