gdsfactory.routing.route_ports_to_x

gdsfactory.routing.route_ports_to_x#

gdsfactory.routing.route_ports_to_x(component: Component, ports: Ports | Sequence[Port] | InstancePorts, cross_section: CrossSectionSpec, x: float | Literal['east', 'west'] = 'east', separation: float = 10.0, radius: float = 10.0, extend_bottom: float = 0.0, extend_top: float = 0.0, extension_length: float = 0.0, y0_bottom: float | None = None, y0_top: float | None = None, backward_port_side_split_index: int = 0, start_straight_length: float = 0.01, dx_start: float | None = None, dy_start: float | None = None, side: Literal['east', 'west'] = 'east', **routing_func_args: Any) tuple[list[ManhattanRoute], list[Port]][source]#

Returns route to x.

Parameters:
  • component – component to route.

  • ports – reasonably well behaved list of ports. ports facing north ports are norther than any other ports ports facing south ports are souther … ports facing west ports are the wester … ports facing east ports are the easter …

  • cross_section – cross_section to use for routing.

  • x – float or string. if float: x coordinate to which the ports will be routed if string: “east” -> route to east if string: “west” -> route to west

  • separation – in um.

  • radius – in um.

  • extend_bottom – in um.

  • extend_top – in um.

  • extension_length – in um.

  • y0_bottom – in um.

  • y0_top – in um.

  • backward_port_side_split_index – integer represents and index in the list of backwards ports (bottom to top) all ports with an index strictly lower or equal are routed bottom all ports with an index larger or equal are routed top.

  • start_straight_length – in um.

  • dx_start – override minimum starting x distance.

  • dy_start – override minimum starting y distance.

  • side – “east” or “west”.

  • routing_func_args – additional arguments to pass to the routing function.

Returns:

list of routes ports: list of the new optical ports

Return type:

routes

  1. routes the bottom-half of the ports facing opposite side of x

  2. routes the south ports

  3. front ports

  4. north ports