Tagged: Bending a straight structure
- This topic has 9 replies, 2 voices, and was last updated 3 years, 10 months ago by
Ronald.
-
AuthorPosts
-
13 March 2021 at 10:13 #6367
Rose Shoaa
ParticipantI 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?thanks
Rose
13 March 2021 at 10:16 #6369Ronald
KeymasterDear Rose,
Would you have a picture of what you like to achieve?
Ronald
14 March 2021 at 13:29 #6370Rose Shoaa
ParticipantDear Ronald
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.
Kind regards
Rose14 March 2021 at 13:35 #6371Rose Shoaa
Participant14 March 2021 at 13:44 #6372Rose Shoaa
ParticipantDear Ronald,
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.Kind regards
Rose15 March 2021 at 22:02 #6373Ronald
KeymasterDear Rose,
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)
Ronald
17 March 2021 at 15:55 #6374Rose Shoaa
ParticipantDear Ronald
Thanks for your help.
How can I generate a gds file from your codes?
Whenever I run the codes, It shows nothing?
Many Thanks
Rose
19 March 2021 at 11:11 #6380Ronald
KeymasterDear Rose,
It generates a png as the one shown in the post.
You may need to add a line likeplt.show()
.
(to poke Matplotlib,import matplotlob.pyplot as plt
)For gds you can use
nd.export_gds(C)
Ronald
22 March 2021 at 10:14 #6385Rose Shoaa
ParticipantDear Ronald
Thanks for your response.
I followed all your instructions but my gds file still shows nothing.
It appears empty (no layers and…).
Any suggestion?
Many Thanks.Rose
22 March 2021 at 18:12 #6390Ronald
KeymasterDear Rose,
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_plt(C)
withnd.export_gds(C)
it exports the gds as expected.Starting layout export... ...gds generation ...Wrote file './nazca_export.gds'
Note-1
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.
Note-2:
nd_export_plt() # deletes/resets the canvas after export nd_export_gds() # nothing to draw
Note-3:
nd_export_plt(clear=False) # does *not* delete the canvas nd_export_gds() # now generates full gds
Ronald
-
AuthorPosts
- You must be logged in to reply to this topic.