Skip to article frontmatterSkip to article content

gdsfactory.routing.route_single

gdsfactory.routing.route_single(component: Component, port1: Port, port2: Port, cross_section: CrossSectionSpec | None = None, layer: LayerSpec | None = None, bend: ComponentSpec = 'bend_euler', straight: ComponentSpec = 'straight', start_straight_length: float = 0.0, end_straight_length: float = 0.0, waypoints: WayPoints | None = None, steps: Sequence[Mapping[Literal['x', 'y', 'dx', 'dy'], int | float]] | None = None, port_type: str | None = None, allow_width_mismatch: bool = False, radius: float | None = None, route_width: float | None = None, auto_taper: bool = True)ManhattanRoute

Returns a Manhattan Route between 2 ports.

The references are straights, bends and tapers.

Parameters
  • componentto place the route into.

  • port1start port.

  • port2end port.

  • cross_sectionspec.

  • layerlayer spec.

  • bendbend spec.

  • straightstraight spec.

  • start_straight_lengthlength of starting straight.

  • end_straight_lengthlength of end straight.

  • waypointsoptional list of points to pass through.

  • stepsoptional list of steps to pass through.

  • port_typeport type to route.

  • allow_width_mismatchallow different port widths.

  • radiusbend radius. If None, defaults to cross_section.radius.

  • route_widthwidth of the route in um. If None, defaults to cross_section.width.

  • auto_taperadd auto tapers.

import gdsfactory as gf

c = gf.Component()
mmi1 = c << gf.components.mmi1x2()
mmi2 = c << gf.components.mmi1x2()
mmi2.move((40, 20))
gf.routing.route_single(c, mmi1.ports["o2"], mmi2.ports["o1"], radius=5, cross_section="strip")
c.plot()