Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strip-to-slot: center pins around y=0 #323

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions klayout/EBeam/pymacros/pcells_EBeam_Beta/strip_to_slot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#%%
import os
from pya import (
PCellDeclarationHelper,
Expand Down Expand Up @@ -91,7 +92,7 @@ def produce_impl(self):

# Draw the **curved arc** for the slot converter
x = 0
y = r + rails / 2 + w + slot
y = r + rails / 2 + w + slot - w / 2
theta = (acos((r - offset) / r) / (2 * pi)) * 360
arc_width = sqrt(r**2 - (r - offset) ** 2)
self.cell.shapes(LayerSiN).insert(
Expand All @@ -100,50 +101,50 @@ def produce_impl(self):

# **Taper polygon**
pts = [
Point.from_dpoint(DPoint(0, w)),
Point.from_dpoint(DPoint(0, 0)),
Point.from_dpoint(DPoint(-taper, w - rails)),
Point.from_dpoint(DPoint(-taper, w)),
Point.from_dpoint(DPoint(0, w - w / 2)),
Point.from_dpoint(DPoint(0, 0 - w / 2)),
Point.from_dpoint(DPoint(-taper, -rails-slot/2)),
Point.from_dpoint(DPoint(-taper, -slot/2)),
]
shapes(LayerSiN).insert(Polygon(pts))

# **Top left half waveguide** (slot side)
wg1 = Polygon(
[
Point.from_dpoint(DPoint(-taper, w + slot)),
Point.from_dpoint(DPoint(-taper, w + slot + rails)),
Point.from_dpoint(DPoint(0, w + slot + wt)),
Point.from_dpoint(DPoint(0, w + slot)),
Point.from_dpoint(DPoint(-taper, slot/2)),
Point.from_dpoint(DPoint(-taper, slot/2 + rails)),
Point.from_dpoint(DPoint(0, w + slot + wt - w / 2)),
Point.from_dpoint(DPoint(0, w + slot - w / 2)),
]
)
shapes(LayerSiN).insert(wg1)

# **Bus waveguide**
wg2 = Box(0, 0, arc_width + wt, w)
wg2 = Box(0, 0 - w / 2, arc_width + wt, w - w / 2)
shapes(LayerSiN).insert(wg2)

# **Pins**
pin_path1 = Path(
[
Point(-taper + pin_length, w + slot / 2),
Point(-taper - pin_length, w + slot / 2),
Point(-taper + pin_length, w / 2 - w / 2),
Point(-taper - pin_length, w / 2 - w / 2),
],
2 * rails + slot,
)
shapes(LayerPinRecN).insert(pin_path1)
text1 = Text("opt1", Trans(Trans.R0, -taper, w))
text1 = Text("opt1", Trans(Trans.R0, -taper, w / 2 - w / 2))
text1.text_size = 0.5 / dbu
shapes(LayerPinRecN).insert(text1)

pin_path2 = Path(
[
Point(arc_width + wt - pin_length, w / 2),
Point(arc_width + wt + pin_length, w / 2),
Point(arc_width + wt - pin_length, w / 2 - w / 2),
Point(arc_width + wt + pin_length, w / 2 - w / 2),
],
w,
)
shapes(LayerPinRecN).insert(pin_path2)
text2 = Text("opt2", Trans(Trans.R0, arc_width + wt, w / 2))
text2 = Text("opt2", Trans(Trans.R0, arc_width + wt, w / 2 - w / 2))
text2.text_size = 0.5 / dbu
shapes(LayerPinRecN).insert(text2)

Expand Down Expand Up @@ -194,3 +195,5 @@ def __init__(self):
from SiEPIC.utils import klive

klive.show(file_out, technology=tech)

# %%