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

Handling top and bottom GC routing #2560

Merged
merged 1 commit into from Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 24 additions & 7 deletions gdsfactory/routing/route_fiber_array.py
Expand Up @@ -341,13 +341,30 @@
):
p0 = io_gratings[i].ports[gc_port_name]
p1 = ordered_ports[i]
waypoints = generate_manhattan_waypoints(
input_port=p0,
output_port=p1,
bend=bend90,
straight=straight,
cross_section=cross_section,
)

# Differentiate between the situation where the structure ports are above or
# below the GC ports
if p0.y > p1.y:
# GC is above the structure - rotuing is a bit more involved as we need to clear
# the rest of GCs
waypoints = generate_manhattan_waypoints(

Check warning on line 350 in gdsfactory/routing/route_fiber_array.py

View check run for this annotation

Codecov / codecov/patch

gdsfactory/routing/route_fiber_array.py#L350

Added line #L350 was not covered by tests
input_port=p0,
output_port=p1,
bend=bend90,
straight=straight,
cross_section=cross_section,
start_straight_length=20,
)

else:
# GC is below structure
waypoints = generate_manhattan_waypoints(
input_port=p0,
output_port=p1,
bend=bend90,
straight=straight,
cross_section=cross_section,
)
route = route_filter(
waypoints=waypoints,
bend=bend90,
Expand Down