From 7980cb8adf5e70f593b5a4eb65a2fbc76dcc1e63 Mon Sep 17 00:00:00 2001 From: fbeutel Date: Wed, 2 Dec 2020 17:10:42 +0100 Subject: [PATCH] Add optional angle parameter Co-authored-by: frank-bp <60472284+frank-bp@users.noreply.github.com> --- gdshelpers/parts/waveguide.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gdshelpers/parts/waveguide.py b/gdshelpers/parts/waveguide.py index 59d792f..a710b0a 100644 --- a/gdshelpers/parts/waveguide.py +++ b/gdshelpers/parts/waveguide.py @@ -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():