gdsfactory.routing.get_bundle_all_angle#
- gdsfactory.routing.get_bundle_all_angle(ports1: list[~gdsfactory.port.Port], ports2: list[~gdsfactory.port.Port], steps: list[~gdsfactory.typings.StepAllAngle] | None = None, cross_section: ~collections.abc.Callable[[...], ~gdsfactory.cross_section.CrossSection] | ~gdsfactory.cross_section.CrossSection | dict[str, ~typing.Any] | str | ~gdsfactory.cross_section.Transition = 'xs_sc', bend: ~collections.abc.Callable[[...], ~gdsfactory.component.Component] = <function bend_euler>, connector: str | ~collections.abc.Callable[[...], list[~gdsfactory.component_reference.ComponentReference]] = 'low_loss', start_angle: float | None = None, end_angle: float | None = None, end_connector: str | ~collections.abc.Callable[[...], list[~gdsfactory.component_reference.ComponentReference]] | None = None, end_cross_section: ~collections.abc.Callable[[...], ~gdsfactory.cross_section.CrossSection] | ~gdsfactory.cross_section.CrossSection | dict[str, ~typing.Any] | str | ~gdsfactory.cross_section.Transition | None = None, separation: float = 3, **kwargs) list[Route] [source]#
Connects a bundle of ports, allowing steps which create waypoints at arbitrary, non-manhattan angles.
- Parameters:
ports1 – ports at the start of the bundle.
ports2 – ports at the end of the bundle.
steps – a list of steps, which contain directives on how to proceed with the route. “x”, “y”, “dx”, “dy”, “ds”, “exit_angle”, “cross_section”, “connector”, “separation”. The first route, between ports1[0] and ports2[0] will take on the role of the primary route, and other routes will follow, given the bundling logic. It is assume that both ports1 and ports2 are sorted. cross_section: the default cross-section of the bends. Then the specified connector may also use this information for straights in between.
bend – the default component to use for the bends.
connector – the default connector to use to connect between two ports.
start_angle – if defined and different from the angle of port1, will cap the starting port with a bend, as to exit with this angle.
end_angle – if defined, and different from the angle of port2, will cap the ending port with a bend, as to exit with this angle.
end_connector – specifies the connector to use for the final straight segment of the route.
end_cross_section – specifies the cross section to use for the final straight segment of the route.
separation – specifies the separation between adjacent routes.
kwargs – added for compatibility, but in general, kwargs will be ignored with a warning.
- Returns:
List of Routes between ports1 and ports2.
import gdsfactory as gf c = gf.Component("demo") mmi = gf.components.mmi2x2(width_mmi=10, gap_mmi=3) mmi1 = c << mmi mmi2 = c << mmi mmi2.move((100, 30)) mmi2.rotate(30) routes = gf.routing.get_bundle_all_angle( mmi1.get_ports_list(orientation=0), [mmi2.ports["o2"], mmi2.ports["o1"]], connector=None, ) for route in routes: c.add(route.references) c.plot()
(
Source code
,png
,hires.png
,pdf
)