SBendFanout

class ipkiss3.all.SBendFanout

Create S-bend-like routes that fanout all the start ports to evenly spaced outputs. To be used with a bundle connector.

The fanout will route to the nearest manhattan angle and works best when:

  • The ports are placed perpendicular to this angle

  • The ports are oriented towards this angle

Parameters:
end_position: ( Coord2 ), optional, *None allowed*

Target end position of the reference. If None, the fanout is made as compact as possible.

reference: optional, *None allowed*

Port (instance:port identifier or an actual i3.Port) to align the fanout with. If None, the center of the inputs is used as reference.

max_sbend_angle: float, optional

The maximum angle for the S-bends in the fanout. Defaults to 90 degrees to make the fanout as compact as possible. Lower this value for more gradual bends.

Examples

Use reference and end_position to control the alignment of the fanout:

import si_fab.all as pdk  # noqa: F401
import ipkiss3.all as i3

start_ports = [
    i3.OpticalPort(name=f"start_port_{i}", position=(0.0, -20.0 + 10 * i), angle=0) for i in range(0, 5)
]
end_ports = [
    i3.OpticalPort(name=f"end_port_{i}", position=(200.0, -20.0 + 10 * i), angle=180) for i in range(0, 5)
]

circuit = i3.Circuit(
    specs=[
        i3.ConnectManhattanBundle(
            connections=list(zip(start_ports, end_ports)),
            start_fanout=i3.SBendFanout(),
            end_fanout=i3.SBendFanout(),
        )
    ]
)

lv = circuit.Layout()
lv.visualize()

circuit = i3.Circuit(
    specs=[
        i3.ConnectManhattanBundle(
            connections=list(zip(start_ports, end_ports)),
            start_fanout=i3.SBendFanout(
                # Route the first start port to (25, -50).
                reference=start_ports[0],
                end_position=(25, -50),
            ),
            end_fanout=i3.SBendFanout(
                # Align the fanout with the last end port.
                reference=end_ports[-1]
            ),
        )
    ]
)

lv = circuit.Layout()
lv.visualize()
../../../../_images/ipkiss3-all-SBendFanout-1_00.png
../../../../_images/ipkiss3-all-SBendFanout-1_01.png

Use the max_sbend_angle property to control the angle of the S-bends:

import si_fab.all as pdk  # noqa: F401
import ipkiss3.all as i3

start_ports = [
    i3.OpticalPort(name=f"start_port_{i}", position=(0.0, -20.0 + 10 * i), angle=0) for i in range(0, 5)
]
end_ports = [
    i3.OpticalPort(name=f"end_port_{i}", position=(100.0, -20.0 + 10 * i), angle=180) for i in range(0, 5)
]

circuit = i3.Circuit(
    specs=[
        i3.ConnectManhattanBundle(
            connections=list(zip(start_ports, end_ports)),
            start_fanout=i3.SBendFanout(max_sbend_angle=70),
            end_fanout=i3.SBendFanout(max_sbend_angle=25),
        )
    ]
)

lv = circuit.Layout()
lv.visualize()
../../../../_images/ipkiss3-all-SBendFanout-2.png