Skip to content

Commit

Permalink
Merge pull request HelgeGehring#38 from fbeutel/waveguide_left_right
Browse files Browse the repository at this point in the history
Waveguide: Add convenience methods for 90° left and right turns
  • Loading branch information
HelgeGehring authored Dec 3, 2020
2 parents 9dfef46 + 7980cb8 commit 1c875f1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gdshelpers/parts/waveguide.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,18 @@ def add_straight_segment_until_level_of_port(self, port, **line_kw):
self.add_straight_segment_to_intersection(port.origin, port.angle - np.pi / 2, **line_kw)
return self

def add_left_bend(self, radius, angle=np.pi/2):
"""
Add a left turn (90° or as defined by angle) with the given bend radius
"""
return self.add_bend(angle, radius)

def add_right_bend(self, radius, angle=np.pi/2):
"""
Add a right turn (90° or as defined by angle) with the given bend radius
"""
return self.add_bend(-angle, radius)


def _example():
from gdshelpers.geometry.chip import Cell
Expand Down

0 comments on commit 1c875f1

Please sign in to comment.