Skip to content

Commit

Permalink
Add optional angle parameter
Browse files Browse the repository at this point in the history
Co-authored-by: frank-bp <[email protected]>
  • Loading branch information
fbeutel and frank-bp authored Dec 2, 2020
1 parent be3cc2a commit 7980cb8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gdshelpers/parts/waveguide.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,17 +546,17 @@ 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):
def add_left_bend(self, radius, angle=np.pi/2):
"""
Add a 90° left turn with the given bend radius
Add a left turn (90° or as defined by angle) with the given bend radius
"""
return self.add_bend(0.5*np.pi, bend_radius)
return self.add_bend(angle, radius)

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


def _example():
Expand Down

0 comments on commit 7980cb8

Please sign in to comment.