gdsfactory.routing.route_sharp

Contents

gdsfactory.routing.route_sharp#

gdsfactory.routing.route_sharp(component, port1, port2, width=None, path_type='manhattan', manual_path=None, layer=None, cross_section=None, port_names=('o1', 'o2'), **kwargs)[source]#

Returns Component route between ports.

Parameters:
  • component (Component) – Component to add the route to.

  • port1 (typings.Port) – start port.

  • port2 (typings.Port) – end port.

  • width (float | None) – None, int, float, array-like[2], or CrossSection. If None, the route linearly tapers between the widths the ports If set to a single number (e.g. width=1.7): makes a fixed-width route If set to a 2-element array (e.g. width=[1.8,2.5]): makes a route whose width varies linearly from width[0] to width[1] If set to a CrossSection: uses the CrossSection parameters for the route.

  • path_type (str) – {‘manhattan’, ‘L’, ‘U’, ‘J’, ‘C’, ‘V’, ‘Z’, ‘straight’, ‘manual’}.

  • manual_path (Path | None) – array-like[N][2] or Path Waypoint for manual route.

  • layer (LayerSpec | None) – Layer to put route on.

  • cross_section (CrossSectionSpec | None) – CrossSection to use for the route.

  • port_names (tuple[str, str]) – Tuple of port names for the start and end of the route.

  • kwargs (Any) – Keyword arguments passed to the waypoint path function.

Return type:

None

Method of waypoint path creation. Should be one of:

  • manhattan: automatic manhattan routing (see path_manhattan() ).

  • L: L-shaped path for orthogonal ports that can be directly connected.

  • U: U-shaped path for parallel or facing ports.

  • J: J-shaped path for orthogonal ports that cannot be directly connected.

  • C: C-shaped path for ports that face away from each other.

  • Z: Z-shaped path with three segments for ports at any angles.

  • V: V-shaped path with two segments for ports at any angles.

  • straight: straight path for ports that face each other.

  • manual: use an explicit waypoint path provided in manual_path.

import gdsfactory as gf

c = gf.Component()
c1 = c << gf.components.pad(port_orientation=None)
c2 = c << gf.components.pad(port_orientation=None)

c2.movex(400)
c2.movey(-200)

gf.routing.route_sharp(c, c1.ports["e4"], c2.ports["e1"], path_type="L")
c.plot()

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

../_images/gdsfactory-routing-route_sharp-1.png