Classes and functions

Helper functions for drawing and geometry

AlcyonPDK_utils.python.commons.drawing_tools.cast_contact_points(list_of_cpoints: list)[source]

Cast list of iterables to pya.DPoints :param list_of_cpoints: :return:

AlcyonPDK_utils.python.commons.drawing_tools.convert_pins_to_points(pins: list | DPath)[source]

Compute mid point of a PIN

Args:
  • pins (list of pya.DPaths or single pya.DPath): list of pins as pya.DPaths

Returns:
  • c_points (list of pya.DPoints or pya.DPoint): list of each pin pya.DPoint mid point

AlcyonPDK_utils.python.commons.drawing_tools.create_arc(origin: tuple = (3, 3), num_points: int = 10, arc_angle_rads: float = 1.57079632679, r1: float = 1, c0_location: str = 'l', direction: str = 'up', width: float = 1) -> (<class 'list'>, <class 'list'>)[source]

Create arc (with width)

Args:
  • origin: arc’s center

  • num_points: number of points per micron

  • arc_angle_rads = arc’s angle (RADIANS)

  • r1 = arc’s radius

  • c0_location: location for c_0

  • direction: drawing direction

  • offset: radians at the beggining and end of the arc for which the arc will be tangent to port pin

  • width: arc’s width

Returns:
  • inner_points (list): list of pya.DPoints of the inner arc

  • outer_points (list): list of pya.DPoints of the outer arc

AlcyonPDK_utils.python.commons.drawing_tools.create_simple_arc(origin: tuple = (3, 3), num_points: int = 10, arc_angle_rads: float = 1.57079632679, r1: float = 1, c0_location: str = 'l', direction: str = 'up') list[source]

Create arc (with width)

Args:
  • origin: arc’s center

  • num_points: number of points per micron

  • arc_angle_rads = arc’s angle (RADIANS)

  • r1 = arc’s radius

  • c0_location: location for c_0

  • direction: drawing direction

Returns:
  • points (list): list of pya.DPoints

AlcyonPDK_utils.python.commons.drawing_tools.generate_rect_point_series(n_paths: int = 10, origin: tuple = (0, 0), period_length: float = 100, dc: float = 200, tilt: float = 0, rotation: float = 0, rot_point: tuple = (0, 0))[source]

Generate the initial and end points of a series of periodic paths

1st. The points are computed as y-aligned

2nd. The points are rotated

Args:
  • num_paths: number of paths in the series

  • origin: location of the first path’s initial point

  • period_length: period length

  • dc: duty cycle

  • tilt: each path’s tilt angle in radians. Each path is rotated around its center

  • rotation: rotation angle in radians around the origin

  • rot_point: rotation’s center

Returns:
  • initial_points: list of pya.DPoints with the location of the initial points of each cell

  • end_points: list of pya.DPoints with the location of the final points of each cell

  • c_0: contact point 0

  • c_1: contact point 1

AlcyonPDK_utils.python.commons.drawing_tools.get_s_bend_points(origin: tuple = (0, 0), length: float = 0, width: float = 0.5, y_offset: float = 1, n_points: int = 100, rotation_rads: float = 0, inverted: bool = False, rot_point=False)[source]

Get points of a S-bend

Args:
  • origin: origin of the s-bend

  • length: length of the s-bend

  • width: s-bend path’s width

  • y_offset: distance betwen min-y and max-y of the s.bend

  • n_points: number of s-bend points

  • rotation_rads: rotation angle in RADIANS

  • inverted: whether to return an inverted s-bend

  • rot_point: optional center of rotation. If False, rotation is performed around the s_bend’s first point

Returns:
  • p_bend_1 (np.array): numpy array of s-bend points

  • s_bend_c_0 (np.array): s-bend’s first point

  • s_bend_c_1 (np.array): s-bend’s last point

AlcyonPDK_utils.python.commons.drawing_tools.get_s_bend_points_2(origin: tuple = (0, 0), length: float = 11, y_offset: float = 10, offset: float = 0.1, n_points: int = 100)[source]

Get points of a S-bend Args:

  • origin: origin of the s-bend

  • length: length of the s-bend

  • y_offset: distance betwen min-y and max-y of the s.bend, if negative: mirrored with respect to x axis

  • offset: length next to the ports that is tangencial to port pin, forces flat input and output

  • n_points: number of s-bend points per micron!!

Returns:
  • p_sbend (np.array): numpy array of s-bend points

  • c_0 (np.array): s-bend’s first point

  • c_1 (np.array): s-bend’s last point

AlcyonPDK_utils.python.commons.drawing_tools.rotate_2d(point: tuple | list | ndarray | DPoint | Vector | Point, angle_rads: float)[source]

2D Rotation of a single point

Args:
  • point: 2D-point. Must be an iterable with two elements (x, y)

  • angle_rads (float): rotation angle_rads in radians

Returns:
  • rot_p: rotated 2D point

AlcyonPDK_utils.python.commons.drawing_tools.rotate_point_list(point_list: list, angles_rads: list | float, pivot_points: list | DPoint)[source]

Rotate a list of points given angles_rads and rotation centers

Args:
  • point_list: the list of pya.DPoints

  • angles_rads (list of floats or single float): angle or list of angles_rads

  • pivot_points (list of pya.DPoints or single point): rotation centers or center

Returns:

List of rotated points

AlcyonPDK_utils.python.commons.drawing_tools.y_junction(origin: tuple = (0, 0), length: float = 0, width: float = 0.5, y_offset: float = 1, n_points: int = 100, rotation_rads: float = 0)[source]

Return the points of a Y-junction. The y-junction is build from 2 s-bends, one of the inverted.

Args:
  • origin: origin of the s-bend

  • length: length of the s-bend

  • width: s-bend path’s width

  • y_offset: distance betwen min-y and max-y of the s.bend

  • n_points: number of s-bend points

  • rotation_rads: rotation angle in RADIANS

Returns:
  • [p_bend_1, p_bend_2]

  • [c_1_0, c_1_1, c_2_0, c_2_1]