ipkiss3.all.ConnectBend¶
- class ipkiss3.all.ConnectBend(connections=None, *args, **kwargs)
Connector for creating an as simple as possible bend between two optical ports based on the given rounding parameters.
When possible, a single arc bend is used. When the ports are (almost) pointing towards each other, this yields an (pseudo) S-bend. When the ports are (almost) aligned, this yields a (pseudo) U-bend.
ConnectBend tries to handle as much cases as possible, but it does not guarantee that the routes are optimal or that there are no crossings. If no valid route could be calculated with the given rounding algorithm and parameters, an exception is raised.
This connector is supposed to be used together with
i3.place_and_route
.- Parameters
- angle_step: float, optional
Angle step to be used in the bends
- bend_radius: float and number > 0, optional
Bend radius.
- end_straight: float and Real, number and number >= 0, optional
Straight length before the end port.
- min_spacing: float and Real, number and number >= 0, optional
minimal spacing between parallel sections of the route
- rounding_algorithm: optional
Rounding algorithm (ShapeRound, ShapeRoundAdiabaticSpline, …). Takes a shape as input and returns a new (rounded) shape.
- start_straight: float and Real, number and number >= 0, optional
Straight length after the start port.
- trace_template: ( PCell and _TraceTemplate ), optional, *None allowed*
Trace template to use for the waveguide between the two ports, when the ports have a different template, transitions will be added. When this property is left unspecified/None the trace_template of the start_port will be used
See also
Examples
import ipkiss3.all as i3 input_port = i3.OpticalPort(name="in", position=(5.0, 0.0)) output_port = i3.OpticalPort(name="out", position=(25.0, 5.0), angle_deg=180.0) # connect the ports wg = i3.ConnectBend.connect(start_port=input_port, end_port=output_port, bend_radius=10) wg_layout = wg.get_default_view(i3.LayoutView) wg_layout.visualize(annotate=True)
import ipkiss3.all as i3 RA = i3.SplineRoundingAlgorithm(adiabatic_angles=(20.0, 20.0)) input_port = i3.OpticalPort(name="in", position=(5.0, 0.0), angle=30.0) output_port = i3.OpticalPort(name="out", position=(30.0, -10.0), angle_deg=210.0) # connect the ports wg = i3.ConnectBend.connect(start_port=input_port, end_port=output_port, rounding_algorithm=RA, bend_radius=4.0) wg_layout = wg.get_default_view(i3.LayoutView) wg_layout.visualize(annotate=True)
import ipkiss3.all as i3 input_port = i3.OpticalPort(name="in", position=(0.0, 0.0), angle=10.0) output_port = i3.OpticalPort(name="out", position=(0.0, 20.0), angle=10.0) wg = i3.ConnectBend.connect(start_port=input_port, end_port=output_port) wg.get_default_view(i3.LayoutView).visualize()
import ipkiss3.all as i3 input_port = i3.OpticalPort(name="in", position=(0.0, 0.0), angle=0.0) output_port = i3.OpticalPort(name="out", position=(-30.0, 30.0), angle=180.0) bend_radius = 10.0 ra = i3.ShapeRound wg = i3.ConnectBend.connect( start_port=input_port, end_port=output_port, bend_radius=bend_radius, rounding_algorithm=ra ) wg.get_default_view(i3.LayoutView).visualize() ra = i3.SplineRoundingAlgorithm(adiabatic_angles=(10, 10)) wg = i3.ConnectBend.connect( start_port=input_port, end_port=output_port, bend_radius=bend_radius, rounding_algorithm=ra ) wg.get_default_view(i3.LayoutView).visualize()
ConnectBend will automatically introduce tapers when required to connect the ports together.:
from technologies.silicon_photonics import TECH # noqa:F401 from picazzo3.traces.wire_wg.trace import WireWaveguideTemplate from picazzo3.traces.rib_wg.trace import RibWaveguideTemplate import ipkiss3.all as i3 rib_tpl = RibWaveguideTemplate() rib_tpl.Layout( core_width=1.0, cladding_width=4.0, ) wire_tpl = WireWaveguideTemplate() wire_tpl.Layout(core_width=0.5, cladding_width=3) start_port = i3.OpticalPort( name="in", position=(5.0, 0.0), angle=30.0, trace_template=rib_tpl, ) end_port = i3.OpticalPort( name="out", position=(30.0, -10.0), angle_deg=210.0, trace_template=wire_tpl, ) # connect the ports wg = i3.ConnectBend.connect(start_port, end_port, bend_radius=4.0) wg_layout = wg.get_default_view(i3.LayoutView) wg_layout.visualize(annotate=True) # you can also set the desired trace_template for the # connection: wg = i3.ConnectBend.connect(start_port=start_port, end_port=end_port, trace_template=wire_tpl) wg_layout = wg.get_default_view(i3.LayoutView) wg_layout.visualize(annotate=True)