Routing

get_route

get_route returns a Manhattan route between two ports.

get_route only works for an individual routes. For routing groups of ports you need to use get_bundle instead

To make a route, you need to supply:

  • input port

  • output port

  • bend_factory

  • straight_factory

  • taper_factory to taper to wider straights and reduce straight loss (Optional)

To generate a straight route:

1. Generate the backbone of the route. This is a list of manhattan coordinates that the route would pass through if it used only sharp bends (right angles)

  1. Replace the corners by bend references (with rotation and position computed from the manhattan backbone)

  2. Add tapers if needed and if space permits

  3. generate straight portions in between tapers or bends

A Route is a dataclass with:

  • references: list of references for tapers, bends and straight waveguides

  • ports: a dict of port name to Port, usually two ports “input” and “output”

  • length: a float with the length of the route

gdsfactory.routing.get_route.get_route(input_port, output_port, bend_factory=<function bend_euler>, straight_factory=<function straight>, taper_factory=None, start_straight=0.01, end_straight=0.01, min_straight=0.01, cross_section=functools.partial(<cyfunction cross_section>), **kwargs)[source]

Returns a Manhattan Route between 2 ports The references are straights, bends and tapers. get_route is an automatic version of get_route_from_steps

Parameters
  • input_port (Port) – start port

  • output_port (Port) – end port

  • bend_factory (Union[Callable[…, Component], Component]) – function that return bends

  • straight_factory (Union[Callable[…, Component], Component]) – function that returns straights

  • taper_factory (Optional[Callable[…, Component]]) –

  • start_straight (Union[float, int]) – length of starting straight

  • end_straight (Union[float, int]) – Number: length of end straight

  • min_straight (Union[float, int]) – Number: min length of straight

  • cross_section (Callable[…, CrossSection]) –

  • **kwargs – cross_section settings

import gdsfactory as gf

c = gf.Component('sample_connect')
mmi1 = c << gf.components.mmi1x2()
mmi2 = c << gf.components.mmi1x2()
mmi2.move((100, 50))
route = gf.routing.get_route(mmi1.ports["E1"], mmi2.ports['o1'])
c.add(route.references)
c.show()

(Source code)

Return type

Route

gdsfactory.routing.get_route.get_route_electrical(input_port: gdsfactory.port.Port, output_port: gdsfactory.port.Port, *, bend_factory: Union[Callable[[...], gdsfactory.component.Component], gdsfactory.component.Component] = <function wire_corner>, straight_factory: Union[Callable[[...], gdsfactory.component.Component], gdsfactory.component.Component] = <function straight>, taper_factory: Optional[Callable[[...], gdsfactory.component.Component]] = None, start_straight: Union[float, int] = 10, end_straight: Union[float, int] = 10, min_straight: Union[float, int] = 0.01, cross_section: Callable[[...], gdsfactory.cross_section.CrossSection] = functools.partial(<cyfunction cross_section>, layer=(49, 0), width=10.0, port_names=('e1', 'e2'), port_types=('electrical', 'electrical')), **kwargs)gdsfactory.types.Route

Returns a Manhattan Route between 2 ports The references are straights, bends and tapers. get_route is an automatic version of get_route_from_steps

Parameters
  • input_port – start port

  • output_port – end port

  • bend_factory – function that return bends

  • straight_factory – function that returns straights

  • taper_factory

  • start_straight – length of starting straight

  • end_straight – Number: length of end straight

  • min_straight – Number: min length of straight

  • cross_section

  • **kwargs – cross_section settings

import gdsfactory as gf

c = gf.Component('sample_connect')
mmi1 = c << gf.components.mmi1x2()
mmi2 = c << gf.components.mmi1x2()
mmi2.move((100, 50))
route = gf.routing.get_route(mmi1.ports["E1"], mmi2.ports['o1'])
c.add(route.references)
c.show()

(Source code)

gdsfactory.routing.get_route.get_route_from_waypoints(waypoints, bend_factory=<function bend_euler>, straight_factory=<function straight>, taper_factory=<function taper>, route_filter=None, cross_section=functools.partial(<cyfunction cross_section>), **kwargs)[source]

Returns a route formed by the given waypoints with bends instead of corners and optionally tapers in straight sections. Tapering to wider straights reduces the optical loss. get_route_from_waypoints is a manual version of get_route Not that get_route_from_steps is a more concise and convenient version of get_route_from_waypoints also available in gf.routing

Parameters
  • waypoints (Tuple[Tuple[float, float], …]) – Coordinates that define the route

  • bend_factory (Callable) – function that returns bends

  • straight_factory (Callable) – function that returns straight waveguides

  • taper_factory (Optional[Callable]) – function that returns tapers

  • route_filter – FIXME, keep it here. Find a way to remove it.

  • cross_section (Callable[…, CrossSection]) –

  • **kwargs – cross_section settings

import gdsfactory as gf

c = gf.Component('waypoints_sample')

w = gf.components.straight()
left = c << w
right = c << w
right.move((100, 80))

obstacle = gf.components.rectangle(size=(100, 10))
obstacle1 = c << obstacle
obstacle2 = c << obstacle
obstacle1.ymin=40
obstacle2.xmin=25


p0x, p0y = left.ports['E0'].midpoint
p1x, p1y = right.ports['E0'].midpoint
o = 10 # vertical offset to overcome bottom obstacle
ytop = 20


routes = gf.routing.get_route_from_waypoints(
    [
        (p0x, p0y),
        (p0x + o, p0y),
        (p0x + o, ytop),
        (p1x + o, ytop),
        (p1x + o, p1y),
        (p1x, p1y),
    ],
)
c.add(routes.references)
c.show()

(Source code)

Return type

Route

gdsfactory.routing.get_route_from_steps.get_route_from_steps(port1, port2, steps, bend_factory=<function bend_euler>, straight_factory=<function straight>, taper_factory=<function taper>, cross_section=functools.partial(<cyfunction cross_section>), **kwargs)[source]

Returns a route formed by the given waypoints steps bends instead of corners and optionally tapers in straight sections. Tapering to wider straights reduces the optical loss. get_route_from_steps is a manual version of get_route and a more concise and convenient version of get_route_from_waypoints

Parameters
  • port1 (Port) – start port

  • port2 (Port) – end port

  • steps (List[Dict[str, float]]) – changes that define the route [{‘dx’: 5}, {‘dy’: 10}]

  • bend_factory (Union[Callable[…, Component], Component]) – function that returns bends

  • straight_factory (Union[Callable[…, Component], Component]) – function that returns straight waveguides

  • taper_factory (Union[Callable[…, Component], Component, None]) – function that returns tapers

  • cross_section (Callable[…, CrossSection]) –

  • **kwargs – cross_section settings

import gdsfactory as gf

c = gf.Component("get_route_from_steps_sample")
w = gf.components.straight()
left = c << w
right = c << w
right.move((100, 80))

obstacle = gf.components.rectangle(size=(100, 10))
obstacle1 = c << obstacle
obstacle2 = c << obstacle
obstacle1.ymin = 40
obstacle2.xmin = 25

p1 = left.ports['o2']
p2 = right.ports['o2']
route = gf.routing.get_route_from_steps(
    port1=p1,
    port2=p2,
    steps=[
        {"x": 20},
        {"y": 20},
        {"x": 120},
        {"y": 80},
    ],
)
c.add(route.references)
c.plot()
c.show()

(Source code, png, hires.png, pdf)

_images/routing-4.png
Return type

Route

get_bundle

Often, several ports have to be linked together without them crossing each other. One way to tackle simple cases is to use bundle routing. Several functions are available depending on the use case:

gdsfactory.routing.get_bundle.get_bundle(ports1, ports2, separation=5.0, extension_length=0.0, straight_factory=<function straight>, bend_factory=<function bend_euler>, sort_ports=True, end_straight_offset=0.0, start_straight=None, cross_section=functools.partial(<cyfunction cross_section>), **kwargs)[source]

Connects a bundle of ports with a river router. Chooses the correct u_bundle to use based on port angles

Parameters
  • ports1 (List[Port]) – should all be facing in the same direction

  • ports2 (List[Port]) – should all be facing in the same direction

  • separation (float) – bundle separation (center to center)

  • extension_length (float) – adds straight extension

  • bend_factory (Callable[…, Component]) –

  • sort_ports (bool) –

  • end_straight_offset (float) –

  • start_straight (Optional[float]) –

  • cross_section (Callable[…, CrossSection]) –

  • **kwargs – cross_section settings

Return type

List[Route]

Example with two arrays of ports connected using get_bundle

import gdsfactory as gf

@gf.cell
def test_north_to_south():
    dy = 200.0
    xs1 = [-500, -300, -100, -90, -80, -55, -35, 200, 210, 240, 500, 650]

    pitch = 10.0
    N = len(xs1)
    xs2 = [-20 + i * pitch for i in range(N // 2)]
    xs2 += [400 + i * pitch for i in range(N // 2)]

    a1 = 90
    a2 = a1 + 180

    ports1 = [gf.Port("top_{}".format(i), (xs1[i], 0), 0.5, a1) for i in range(N)]
    ports2 = [gf.Port("bottom_{}".format(i), (xs2[i], dy), 0.5, a2) for i in range(N)]

    c = gf.Component()
    routes = gf.routing.get_bundle(ports1, ports2)
    for route in routes:
        c.add(route.references)

    return c


c = test_north_to_south()
c.show()
c.plot()

(Source code, png, hires.png, pdf)

_images/routing-5.png

get bundle is the generic river routing function that will call different function depending on the port orientation. Get bundle acts as a high level entry point. Based on the angle configurations of the banks of ports, it decides which sub-routine to call:

  • get_bundle_same_axis, banks or ports facing each other (but with arbitrary and varying pitch on each side)

  • get_bundle_corner, banks of ports with 90Deg / 270Deg between them (again pitch is flexible on both sides)

  • get_bundle_udirect, banks of ports with direct U-turns

  • get_bundle_uindirect, banks of ports with indirect U-turns

Or you can also call each functions individually

gdsfactory.routing.get_bundle.get_bundle_same_axis(ports1, ports2, separation=5.0, end_straight_offset=0.0, start_straight=0.0, bend_factory=<function bend_euler>, sort_ports=True, cross_section=functools.partial(<cyfunction cross_section>), **kwargs)[source]

Semi auto-routing for two lists of ports.

Parameters
  • ports1 (List[Port]) – first list of ports

  • ports2 (List[Port]) – second list of ports

  • separation (float) – minimum separation between two straights

  • axis

    specifies “X” or “Y”

    X (resp. Y) -> indicates that the ports should be sorted and

    compared using the X (resp. Y) axis

  • route_filter – filter to apply to the manhattan waypoints e.g get_route_from_waypoints for deep etch strip straight

  • end_straight_offset (float) – offset to add at the end of each straight

  • sort_ports (bool) – sort the ports according to the axis.

  • cross_section (Callable[…, CrossSection]) – cross_section

  • **kwargs – cross_section settings

Return type

List[Route]

Returns

[route_filter(r) for r in routes] list of lists of coordinates e.g with default get_route_from_waypoints, returns a list of elements which can be added to a component

The routing assumes manhattan routing between the different ports. The strategy is to modify start_straight and end_straight for each straight such that straights do not collide.

1             X    X     X  X X  X
|-----------|    |     |  | |  |-----------------------|
|          |-----|     |  | |---------------|          |
|          |          ||  |------|          |          |
2 X          X          X          X          X          X

start: at the top end: at the bottom

The general strategy is: Group tracks which would collide together and apply the following method on each group:

if x2 >= x1, increase end_straight

(as seen on the right 3 ports)

otherwise, decrease end_straight

(as seen on the first 2 ports)

We deal with negative end_straight by doing at the end

end_straights = end_straights - min(end_straights)

This method deals with different metal track/wg/wire widths too.

gdsfactory.routing.get_bundle_corner.get_bundle_corner(ports1, ports2, route_filter=<function get_route_from_waypoints>, separation=5.0, **kwargs)[source]
Parameters
  • ports1 (List[Port]) – list of start ports

  • ports2 (List[Port]) – list of end ports

  • route_filter (Callable[…, Route]) – filter to apply to the manhattan waypoints e.g get_route_from_waypoints for deep etch strip straight

Return type

List[Route]

Returns

[route_filter(r) for r in routes] where routes is a list of lists of coordinates e.g with default get_route_from_waypoints, returns a list of elements which can be added to a component

Bend-types

90 Deg bend
           A1 A2      AN
           | |  ...  |
           | |      /
          / /      /
         / /      /
  B1 ----/ /    _/
  B2 -----/     /
               /
    ...      _/
  BN --------/


270 Deg bend
    /------------\
   /              \
  /  /-------\     \
 /  /         \     \
|  /   /--\    |    |
| /  /   |     | ...|
| | /    B1    B2   BN
| | |
| \ \--- A1
|  ----- A2
|    ...
 \------ AN

Connect banks of ports with either 90Deg or 270Deg angle between them

gdsfactory.routing.get_bundle_u.get_bundle_udirect(ports1, ports2, route_filter=<function get_route_from_waypoints>, separation=5.0, start_straight=0.01, end_straight=0.01, start_straight_offset=0.0, end_straight_offset=0.0, bend_factory=<function bend_euler>, **routing_params)[source]
Parameters
  • ports1 (List[Port]) – list of start ports

  • ports2 (List[Port]) – list of end ports

  • route_filter (Callable) – filter to apply to the manhattan waypoints e.g get_route_from_waypoints for deep etch strip straight

  • separation (float) – between straights

  • start_straight (float) –

  • end_straight (float) –

  • start_straight_offset (float) –

  • end_straight_offset (float) –

Return type

List[Route]

Returns

[route_filter(r) for r in routes] where routes is a list of lists of coordinates e.g with default get_route_from_waypoints, returns list of elements which can be added to a component

Used for routing multiple ports back to a bundled input in a component

X: start ports
D: End ports

On this example bellow, the axis is along X

                   X------\
                          |
                   X----\ |
                  ...   | |
                   X--\ | |
                      | | |
  D-------------------/ | |
  ...                   | |
  D---------------------/ |
  D-----------------------
  D-----------------------\
  D---------------------\ |
  ...                   | |
  D-------------------\ | |
                      | | |
                   X--/ | |
                  ...   | |
                   X----/ |
                          |
                   X------/
gdsfactory.routing.get_bundle_u.get_bundle_uindirect(ports1, ports2, route_filter=<function get_route_from_waypoints>, separation=5.0, extension_length=0.0, start_straight=0.01, end_straight=0.01, end_straight_offset=0.0, start_straight_offset=0.0, **routing_params)[source]
Parameters
  • ports1 – list of start ports

  • ports2 – list of end ports

  • route_filter – filter to apply to the manhattan waypoints e.g get_route_from_waypoints for deep etch strip straight

Return type

List[Route]

Returns

[route_filter(r) for r in routes] where routes is a list of lists of coordinates e.g with default get_route_from_waypoints, returns a list of elements which can be added to a component

Used for routing multiple ports back to a bundled input in a component

X: start ports
D: End ports


                            X------
                            X----  |
                           ...   | |
                            X--\ | |
                               | | |
    /--------------------------/ | |
    |                            | |
    | /--------------------------/ |
    | |                            |
    | | /--------------------------/
    | | |
    | | \--D
    | \----D
    |     ...
    \------D
    /------D
    |     ...
    | /----D
    | | /--D
    | | |
    | | \--------------------------
    | |                            |
    | \--------------------------\ |
    |                            | |
    \--------------------------\ | |
                               | | |
                            X--/ | |
                           ...   | |
                            X----/ |
                            X------/
'''

route_ports_to_side

For now get_bundle is not smart enough to decide whether it should call route_ports_to_side. So you either need to connect your ports to face in one direction first, or to use route_ports_to_side before calling get_bundle

gdsfactory.routing.route_ports_to_side.route_ports_to_side(ports, side='north', x=None, y=None, routing_func=<function get_route>, **kwargs)[source]

Routes ports to a given side

Parameters
  • ports (Union[Dict[str, Port], List[Port], Component, ComponentReference]) – the list or dict of ports to be connected to the side can also be a Component or a ComponentReference

  • should be 'north' (side) –

  • 'south'

  • or 'west' ('east') –

  • x (Optional[float]) – only for east/west side routing: the x position where the ports should be sent If None, will use the eastest/westest value

  • y (Optional[float]) – only for south/north side routing: the y position where the ports should be send If None, will use the southest/northest value

  • routing_func – the routing function. By default uses get_route

  • kwargs – radius separation extend_bottom/extend_top for east/west routing extend_left, extend_right for south/north routing

Returns

List of ports:

Return type

List of routes

get_bundle_from_waypoints

gdsfactory.routing.get_bundle_from_waypoints.get_bundle_from_waypoints(ports1, ports2, waypoints, straight_factory=<function straight>, taper_factory=<function taper>, bend_factory=<function bend_euler>, sort_ports=True, cross_section=functools.partial(<cyfunction cross_section>), separation=None, **kwargs)[source]

Returns list of routes that connect bundle of ports with bundle of routes where routes follow a list of waypoints.

Parameters
  • ports1 (List[Port]) – list of ports

  • ports2 (List[Port]) – list of ports

  • waypoints (Tuple[Tuple[float, float], …]) – list of points defining a route

  • straight_factory (Callable) – function that returns straights

  • taper_factory (Callable) – function that returns tapers

  • bend_factory (Callable) – function that returns bends

  • sort_ports (bool) – sorts ports

  • cross_section (Callable[…, CrossSection]) – cross_section

  • separation (Optional[float]) – waveguide separation (center to center)

  • **kwargs – cross_section settings

Return type

List[Route]

import numpy as np
import gdsfactory as gf


@gf.cell
def test_connect_bundle_waypoints():
    """Connect bundle of ports with bundle of routes following a list of waypoints."""
    xs1 = np.arange(10) * 5 - 500.0
    N = xs1.size
    ys2 = np.array([0, 5, 10, 20, 25, 30, 40, 55, 60, 75]) + 500.0

    ports1 = [gf.Port(f"A_{i}", (xs1[i], 0), 0.5, 90) for i in range(N)]
    ports2 = [gf.Port(f"B_{i}", (0, ys2[i]), 0.5, 180) for i in range(N)]

    c = gf.Component()
    waypoints = [
        ports1[0].position + (0, 100),
        ports1[0].position + (200, 100),
        ports1[0].position + (200, -200),
        ports1[0].position + (0, -200),
        ports1[0].position + (0, -350),
        ports1[0].position + (400, -350),
        (ports1[0].x + 400, ports2[0].y),
    ]

    routes = gf.routing.get_bundle_from_waypoints(ports1, ports2, waypoints)
    for route in routes:
        c.add(route.references)

    return c

cell = test_connect_bundle_waypoints()
cell.plot()

(Source code, png, hires.png, pdf)

_images/routing-6.png

get_bundle_path_length_match

gdsfactory.routing.get_bundle_path_length_match.get_bundle_path_length_match(ports1, ports2, separation=30.0, end_straight_offset=None, extra_length=0.0, nb_loops=1, modify_segment_i=-2, bend_factory=<function bend_euler>, straight_factory=<function straight>, taper_factory=<function taper>, start_straight=0.0, route_filter=<function get_route_from_waypoints>, sort_ports=True, cross_section=functools.partial(<cyfunction cross_section>), **kwargs)[source]

Returns list of routes that are path length matched.

Parameters
  • ports1 (List[Port]) – list of ports

  • ports2 (List[Port]) – list of ports

  • separation (float) – between the loops

  • end_straight_offset (Optional[float]) – if None tries to determine it

  • extra_length (float) – distance added to all path length compensation. Useful is we want to add space for extra taper on all branches

  • nb_loops (int) – number of extra loops added in the path

  • modify_segment_i (int) – index of the segment that accomodates the new turns default is next to last segment

  • bend_factory (Callable[…, Component]) – for bends

  • straight_factory (Callable) – for straights

  • taper_factory (Optional[Callable]) –

  • start_straight (float) –

  • route_filter (Callable) – get_route_from_waypoints

  • sort_ports (bool) – sorts ports before routing

  • cross_section (Callable[…, CrossSection]) – factory

  • **kwargs – cross_section settings

Tips:

  • If path length matches the wrong segments, change modify_segment_i arguments.

  • Adjust nb_loops to avoid too short or too long segments

  • Adjust separation and end_straight_offset to avoid compensation collisions

import gdsfactory as gf

c = gf.Component("path_length_match_sample")

dy = 2000.0
xs1 = [-500, -300, -100, -90, -80, -55, -35, 200, 210, 240, 500, 650]
pitch = 100.0
N = len(xs1)
xs2 = [-20 + i * pitch for i in range(N)]

a1 = 90
a2 = a1 + 180
ports1 = [gf.Port(f"top_{i}", (xs1[i], 0), 0.5, a1) for i in range(N)]
ports2 = [gf.Port(f"bottom_{i}", (xs2[i], dy), 0.5, a2) for i in range(N)]

routes = gf.routing.get_bundle_path_length_match(
    ports1, ports2, extra_length=44
)
for route in routes:
    c.add(route.references)
c.plot()

(Source code, png, hires.png, pdf)

_images/routing-7.png
Return type

List[Route]

add_fiber_array / add_fiber_single

In cases where individual components have to be tested, you can generate the array of optical I/O and connect them to the component.

You can connect the waveguides to a 127um pitch fiber array.

gdsfactory.routing.add_fiber_array.add_fiber_array(component, grating_coupler=functools.partial(<function grating_coupler_elliptical_trenches>, polarization='te', taper_angle=35), straight_factory=<function straight>, bend_factory=<function bend_euler>, gc_port_name='o1', gc_port_labels=None, component_name=None, select_ports=functools.partial(<function select_ports>, port_type='optical'), cross_section=functools.partial(<cyfunction cross_section>), get_input_labels_function=<function get_input_labels>, layer_label=(66, 0), **kwargs)[source]

Returns component with optical IO (tapers, south routes and grating_couplers).

Parameters
  • component (Component) – to connect

  • grating_coupler (Component) – grating coupler instance, function or list of functions

  • bend_factory (Callable[…, Component]) – bend_circular

  • gc_port_name (str) – grating coupler input port name ‘W0’

  • component_name (Optional[str]) – for the label

  • taper – taper function name or dict

  • get_input_labels_function (Optional[Callable]) – function to get input labels for grating couplers

  • get_input_label_text_loopback_function – function to get input label test

  • get_input_label_text_function

  • straight_factory (Callable[…, Component]) – straight

  • fanout_length – None # if None, automatic calculation of fanout length

  • max_y0_optical – None

  • with_loopback – True, adds loopback structures

  • straight_separation – 4.0

  • list_port_labels – None, adds TM labels to port indices in this list

  • connected_port_list_ids – None # only for type 0 optical routing

  • nb_optical_ports_lines – 1

  • force_manhattan – False

  • excluded_ports

  • grating_indices – None

  • routing_straight – None

  • routing_method – get_route

  • optical_routing_type – None: auto, 0: no extension, 1: standard, 2: check

  • gc_rotation – -90

  • layer_label (Optional[Tuple[int, int]]) – LAYER.LABEL

  • input_port_indexes – [0]

import gdsfactory as gf
gf.config.set_plot_options(show_subports=False)

c = gf.components.crossing()
cc = gf.routing.add_fiber_array(
    component=c,
    optical_routing_type=2,
    grating_coupler=gf.components.grating_coupler_elliptical_te,
    with_loopback=False
)
cc.plot()

(Source code, png, hires.png, pdf)

_images/routing-8.png
Return type

Component

Or can also connect to individual fibers for input and output.

gdsfactory.routing.add_fiber_single.add_fiber_single(component, grating_coupler=functools.partial(<function grating_coupler_elliptical_trenches>, polarization='te', taper_angle=35), layer_label=(201, 0), fiber_spacing=50.0, bend_factory=<function bend_circular>, straight_factory=<function straight>, route_filter=<function get_route_from_waypoints>, min_input_to_output_spacing=200.0, optical_routing_type=2, with_loopback=True, component_name=None, gc_port_name='o1', get_input_label_text_loopback_function=<function get_input_label_text_loopback>, get_input_label_text_function=<function get_input_label_text>, select_ports=functools.partial(<function select_ports>, port_type='optical'), cross_section=functools.partial(<cyfunction cross_section>), **kwargs)[source]

Returns component with grating ports and labels on each port.

Can add loopback reference structure next to it.

Parameters
  • component (Union[Callable[…, Component], Component]) – to connect

  • grating_coupler (Callable[…, Component]) – grating coupler instance, function or list of functions

  • layer_label (Tuple[int, int]) – for test and measurement label

  • fiber_spacing (float) – between outputs

  • bend_factory (Callable[…, Component]) – bend_circular

  • straight_factory (Callable[…, Component]) – straight

  • route_filter (Callable) –

  • max_y0_optical – None

  • with_loopback (bool) – True, adds loopback structures

  • straight_separation – 4.0

  • list_port_labels – None, adds TM labels to port indices in this list

  • connected_port_list_ids – None # only for type 0 optical routing

  • nb_optical_ports_lines – 1

  • force_manhattan – False

  • excluded_ports

  • grating_indices – None

  • routing_method – get_route

  • gc_port_name (str) – W0

  • get_input_labels_function – function to get input labels for grating couplers

  • optical_routing_type (int) – None: autoselection, 0: no extension

  • gc_rotation – -90

  • component_name (Optional[str]) – name of component

  • cross_section (Callable[…, CrossSection]) –

  • **kwargs – cross_section settings

      fiber
     ______
    /| | |
   / | | |
W0|  | | |
   \ | | |
  | \|_|_|_

  |
 xmin = 0
import gdsfactory as gf

c = gf.components.crossing()
cc = gf.routing.add_fiber_single(
    component=c,
    optical_routing_type=0,
    grating_coupler=gf.components.grating_coupler_elliptical_te,
)
cc.plot()

(Source code, png, hires.png, pdf)

_images/routing-9.png
Return type

Component