Skip to content

Commit

Permalink
Merge pull request #2560 from mdecea/main
Browse files Browse the repository at this point in the history
Handling top and bottom GC routing
  • Loading branch information
joamatab committed Feb 26, 2024
2 parents 4a66ed9 + 33a1cac commit 887cdb1
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions gdsfactory/routing/route_fiber_array.py
Expand Up @@ -341,13 +341,30 @@ def has_p(side) -> bool:
):
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(
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

0 comments on commit 887cdb1

Please sign in to comment.