Routing API#

single route#

get_route(input_port, output_port[, bend, ...])

Returns a Manhattan Route between 2 ports.

get_route_from_steps(port1, port2[, steps, ...])

Returns a route formed by the given waypoints steps.

route_quad(port1, port2[, width1, width2, layer])

Routes a basic quadrilateral polygon directly between two ports.

route_sharp(port1, port2[, width, ...])

Convenience function that routes a path between ports and immediately extrudes the path to create polygons. Has several waypoint path type options. Equivalent to e.g. >>> P = pr.path_manhattan(port1, port2, radius) >>> D = P.extrude(width).

bundle route#

When you need to route groups of ports together without them crossing each other You can use a bundle/river/bus router. get bundle is the generic river bundle bus 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

get_bundle(ports1, ports2[, separation, ...])

Returns list of routes to connect two groups of ports.


get_bundle_from_steps(ports1, ports2[, ...])

Returns a list of routes formed by the given waypoints steps.

get_bundle_path_length_match(ports1, ports2)

Returns list of routes that are path length matched.


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

route_ports_to_side(ports[, side, x, y, ...])

Routes ports to a given side.

route_south(component[, ...])

Returns Routes to route a component ports to the south.


get_routes_bend180(ports[, bend, ...])

Returns routes made by 180 degree bends.

get_routes_straight(ports[, straight])

Returns routes made by 180 degree straights.

get_route_sbend(port1, port2, **kwargs)

Returns an Sbend Route to connect two ports.

get_bundle_sbend(ports1, ports2[, sort_ports])

Returns a Dict with the routes from ports1 to ports2

fanout2x2([component, port_spacing, ...])

Returns component with Sbend fanout routes.

fanout_component(component, port_names[, ...])

Returns component with Sbend fanout routes.

fanout_ports(ports[, pitch, dx])

Returns fanout Sbend routes.

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 or to individual fibers for input and output.

add_fiber_array.add_fiber_array([component, ...])

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


Returns component with grating couplers and labels on each port.


add_electrical_pads_shortest([component, ...])

Returns new Component with a pad by each electrical port.

add_electrical_pads_top([component, ...])

Returns new component with electrical ports connected to top pad array

add_electrical_pads_top_dc([component, ...])

Returns new component with electrical ports connected to a pad array at the top.