gdsfactory.routing.add_electrical_pads_shortest

gdsfactory.routing.add_electrical_pads_shortest#

gdsfactory.routing.add_electrical_pads_shortest(component: ComponentSpec = functools.partial(<function straight>, cross_section='metal_routing', length=200.0), pad: ComponentSpec = 'pad', pad_port_spacing: float = 50.0, pad_size: tuple[float, float] = (100.0, 100.0), select_ports: ~collections.abc.Callable[[...], ~collections.abc.Sequence[~kfactory.kcell.Port]] = functools.partial(<function select_ports>, port_type='electrical'), port_names: ~collections.abc.Sequence[str] | None = None, port_orientation: float = 90, layer: LayerSpec = 'M3') Component[source]#

Returns new Component with a pad by each electrical port.

Parameters:
  • component – to route.

  • pad – pad element or function.

  • pad_port_spacing – spacing between pad and port.

  • pad_size – pad size.

  • select_ports – function to select ports.

  • port_names – optional port names. Overrides select_ports.

  • port_orientation – in degrees.

  • layer – for the routing.

import gdsfactory as gf
c = gf.components.straight_heater_metal(length=100)
wire_long = gf.components.wire_straight(length=200.)
c = gf.routing.add_electrical_pads_shortest(wire_long)
c.plot()

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

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