route_manhattan¶
- photonforge.parametric.route_manhattan(*, terminal1=None, terminal2=None, direction1=None, direction2=None, layer=None, width=None, overlap_fraction=None, join_limit=None, waypoints=None, technology=None, name=None)¶
Create a Manhattan path connecting 2 terminals.
- Parameters:
terminal1 (Terminal | tuple[Reference, str] | tuple[Reference, str, int]) – First terminal to be connected. The terminal can be specified as a
photonforge.Terminal
or as a tuple including aphotonforge.Reference
, the terminal name, and the repetition index (optional, only for array references).terminal2 (Terminal | tuple[Reference, str] | tuple[Reference, str, int]) – Second terminal to be connected.
direction1 (Literal['', 'x', 'y']) – Direction (“”, “x”, or “y”) of the route at the first terminal.
direction2 (Literal['', 'x', 'y']) – Direction (“”, “x”, or “y”) of the route at the second terminal.
layer (tuple[int]) – Layer used for the connection. If
None
, the routing layer of the first terminal is used.width (float) – Width of the routing path. If
None
, the width is derived from the bounding box of the first terminal.overlap_fraction (float | tuple[float]) – Fraction of the terminal bounding box that the route overlaps. If
None
, defaults to 1.join_limit (float) – Join limit used by
photonforge.Path.segment()
. IfNone
defaults to -1.waypoints (Sequence) – Sequence of coordinates the route should go through.
technology (Technology) – Component technology. If
None
, the default technology is used.name (str) – Component name.
- Returns:
Component with the route.
terminal1 = pf.Terminal("METAL", pf.Rectangle((10, 10)))
terminal2 = pf.Terminal("METAL", pf.Rectangle(center=(180, -70), size=(10, 10)))
component = route_manhattan(
terminal1=terminal1, direction1="x", terminal2=terminal2, waypoints=[(90, 50)]
)