RouteManhattan
- class ipkiss3.all.RouteManhattan
Routes the start_port to the end_port using a manhattan pattern (straight sections along EAST, WEST, NORTH, SOUTH directions).
When the input or output port is not at a Manhattan direction it will be directed first to the closest one.
Optionally you can specify control_points through which the route needs to pass.
- Parameters:
- start_port: Port, required
The port to route from
- end_port: Port, required
The port to route to
- control_points: list, optional
Control the routing by passing either a list of points through which the route has to pass,or a list of i3.H / i3.V instances.
- min_spacing: float and Real, number and number >= 0, optional
minimal spacing between parallel sections of the route
- domain: __Domain__, optional
The domain ( e.g. OpticalDomain, ElectricalDomain) of the route
- angle_out: float, optional
The angle of the end section of the route
- angle_in: float, optional
The angle of start section of the route
- end_straight: float and Real, number and number >= 0, optional
The length of the straight end section of the route
- min_straight: float and Real, number and number >= 0, optional
The minimum length of any straight sections in the route
- angle_step: float and number > 0, optional
Angle step for rounding.
- rounding_algorithm: optional, *None allowed*
rounding algorithm used to generate the bends. Can be circular, spline, …
- bend_radius: float and number > 0, optional
Bend radius for the auto-generated bends.
- start_straight: float and Real, number and number >= 0, optional
The length of the straight start section of the route
- closed: optional
- end_face_angle: ( float ), optional, *None allowed*
Use this to overrule the ‘dangling’ angle at the end of an open shape
- start_face_angle: ( float ), optional, *None allowed*
Use this to overrule the ‘dangling’ angle at the start of an open shape
- points: optional
points of this shape
- Other Parameters:
- end_pos: Coord2, locked
- start_pos: Coord2, locked
- size_info: SizeInfo, locked
get the size information on this Shape
See also
Notes
The route will always go through a control point in one of the Manhattan directions. Hence, control points should not be placed where a bend is desired. In addition, there’s no validation on the control_points property. This means that, although the generated optical route will be bend-radius safe, there’s no guarantee that it will not intersect itself when specifying the control_points.
Examples
import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 start_port = i3.OpticalPort(name="in", position=(5.0, 0.0)) end_port = i3.OpticalPort(name="out", position=(20.0, 30.0), angle_deg=180.0) # create the route object route = i3.RouteManhattan(start_port=start_port, end_port=end_port) # a route is a Shape, so we can use it to draw a waveguide wg = i3.RoundedWaveguide(trace_template=i3.TECH.PCELLS.WG.DEFAULT) layout = wg.Layout(shape=route) layout.visualize()
""" You can also create routes that don't take the sizes of bends into account, by setting rounding_algorithm to None. This is useful when you don't want your traces to be rounded: """ import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 start_port = i3.OpticalPort(name="in", position=(5.0, 0.0)) end_port = i3.OpticalPort(name="out", position=(20.0, 30.0), angle_deg=180.0) # create the route object route = i3.RouteManhattan(start_port=start_port, end_port=end_port, rounding_algorithm=None) # a route is a Shape, so we can use it to draw a waveguide wg = i3.Waveguide(trace_template=i3.TECH.PCELLS.WG.DEFAULT) layout = wg.Layout(shape=route) layout.visualize()
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) route = i3.RouteManhattan(input_port=input_port, output_port=output_port, bend_radius=8.0, end_straight=8.0) wg = i3.RoundedWaveguide() layout = wg.Layout(shape=route) layout.visualize()
""" Routing between electrical ports works equally well. """ import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 start_port = i3.ElectricalPort(name="in", position=(5.0, 0.0)) end_port = i3.ElectricalPort(name="out", position=(20.0, 50.0)) # create the route object route = i3.RouteManhattan(start_port=start_port, end_port=end_port) tpl = i3.ElectricalWireTemplate() wire = i3.ElectricalWire(trace_template=tpl) layout = wire.Layout(shape=route) layout.visualize()
""" It's important to remark that ElectricalPorts don't have an angle by default. By default the direction of the route will be based on the angle of the flightline between the two specified ports. You can also force the direction of the port by specifying an angle, this is demonstrated in this example """ import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 start_port = i3.ElectricalPort(name="in", position=(5.0, 0.0)) end_port = i3.ElectricalPort(name="out", position=(20.0, 50.0)) # create the route object route = i3.RouteManhattan(start_port=start_port, end_port=end_port) tpl = i3.ElectricalWireTemplate() wire = i3.ElectricalWire(trace_template=tpl) layout = wire.Layout(shape=route) layout.visualize()