gdsfactory.routing.route_quad

Contents

gdsfactory.routing.route_quad#

gdsfactory.routing.route_quad(component: Component, port1: Port, port2: Port, width1: float | None = None, width2: float | None = None, layer: tuple[int, int] | str | int | LayerEnum = 'M1', manhattan_target_step: float | None = None) None[source]#

Routes a basic quadrilateral polygon directly between two ports.

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

  • port1 – Port to start route.

  • port2 – Port objects to end route.

  • width1 – Width of quadrilateral at ports. If None, uses port widths.

  • width2 – Width of quadrilateral at ports. If None, uses port widths.

  • layer – Layer to put the route on.

  • manhattan_target_step – if not none, min step to manhattanize the polygon

import gdsfactory as gf

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

(Source code)