Skip to content

Commit

Permalink
Waveguide: Add convenience methods for 90° left and right turns
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutel committed Dec 2, 2020
1 parent 9dfef46 commit be3cc2a
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(self, bend_radius):
"""
Add a 90° left turn with the given bend radius
"""
return self.add_bend(0.5*np.pi, bend_radius)

def add_right(self, bend_radius):
"""
Add a 90° right turn with the given bend radius
"""
return self.add_bend(-0.5*np.pi, bend_radius)


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

0 comments on commit be3cc2a

Please sign in to comment.