gdsfactory.routing.route_south

Contents

gdsfactory.routing.route_south#

gdsfactory.routing.route_south(component: Component, component_to_route: Component | ComponentReference, optical_routing_type: int = 1, excluded_ports: tuple[str, ...] | None = None, straight_separation: float = 4.0, io_gratings_lines: list[list[ComponentReference]] | None = None, gc_port_name: str = 'o1', bend: ComponentSpec = <function bend_euler>, straight: ComponentSpec = <function straight>, taper: ComponentSpec | None = <function taper>, select_ports: Callable = functools.partial(<function select_ports>, port_type='optical'), port_names: Strs | None = None, cross_section: CrossSectionSpec = functools.partial(<function cross_section>, radius=10, radius_min=5), start_straight_length: float = 0.5, port_type: str = 'optical', allow_width_mismatch: bool = False) list[OpticalManhattanRoute][source]#

Places routes to route a component ports to the south.

Parameters:
  • component – top level component to add the routes.

  • component_to_route – component or reference to route ports to south.

  • optical_routing_type – routing heuristic 1 or 2 1: uses the component size info to estimate the box size. 2: only looks at the optical port positions to estimate the size.

  • excluded_ports – list of port names to NOT route.

  • straight_separation – in um.

  • io_gratings_lines – list of ports to which the ports produced by this function will be connected. Supplying this information helps avoiding straight collisions.

  • gc_port_name – grating coupler port name. Used only if io_gratings_lines is supplied.

  • bend – spec.

  • straight – spec.

  • taper – spec.

  • select_ports – function to select_ports.

  • port_names – optional port names. Overrides select_ports.

  • cross_section – cross_section spec.

  • start_straight_length – in um.

  • port_type – optical or electrical.

  • allow_width_mismatch – allow width mismatch.

Works well if the component looks roughly like a rectangular box with:

north ports on the north of the box. south ports on the south of the box. east ports on the east of the box. west ports on the west of the box.

import gdsfactory as gf

c = gf.components.ring_double()
c = gf.Component()
ref = c << gf.components.ring_double()
r = gf.routing.route_south(ref)
for e in r.references:
    c.add(e)
c.plot()

(Source code)