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 [source]#
Returns a Manhattan Route between 2 ports.
The references are straights, bends and tapers. route_single is an automatic version of route_single_from_steps.
- Parameters:
component – to place the route into.
port1 – start port.
port2 – end port.
cross_section – spec.
layer – layer spec.
bend – bend spec.
straight – straight spec.
start_straight_length – length of starting straight.
end_straight_length – length of end straight.
waypoints – optional list of points to pass through.
steps – optional list of steps to pass through.
port_type – port type to route.
allow_width_mismatch – allow different port widths.
radius – bend radius. If None, defaults to cross_section.radius.
route_width – width of the route in um. If None, defaults to cross_section.width.
auto_taper – add auto tapers.
import gdsfactory as gf c = gf.Component() mmi1 = c << gf.components.mmi1x2() mmi2 = c << gf.components.mmi1x2() mmi2.dmove((40, 20)) gf.routing.route_single(c, mmi1.ports["o2"], mmi2.ports["o1"], radius=5, cross_section="strip") c.plot()
(
Source code
,png
,hires.png
,pdf
)