gdsfactory.routing.route_quad

Contents

gdsfactory.routing.route_quad#

gdsfactory.routing.route_quad(component, port1, port2, width1=None, width2=None, layer='M1', manhattan_target_step=None)[source]#

Routes a basic quadrilateral polygon directly between two ports.

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

  • port1 (DPort) – Port to start route.

  • port2 (DPort) – Port objects to end route.

  • width1 (float | None) – Width of quadrilateral at ports. If None, uses port widths.

  • width2 (float | None) – Width of quadrilateral at ports. If None, uses port widths.

  • layer (tuple[int, int] | str | int | LayerEnum) – Layer to put the route on.

  • manhattan_target_step (float | None) – if not none, min step to manhattanize the polygon

Return type:

None

import gdsfactory as gf

c = gf.Component()
pad1 = c << gf.components.pad(size=(50, 50))
pad2 = c << gf.components.pad(size=(10, 10))
pad2.movex(100)
pad2.movey(50)
gf.routing.route_quad(
    c,
    pad1.ports["e2"],
    pad2.ports["e4"],
    width1=None,
    width2=None,
)
c.plot()

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

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