get_acute_angle_points

ipkiss3.pcell.layout.operations.get_acute_angle_points(layout, layers=[], angle_threshold=0.0)

Returns a dictionary of points that form an acute angle per given layer in a given layout.

The layout gets flattened and the elements on the same layer are merged together before determining the acute angles. The returned points are snapped to the grid.

Parameters:

layout: Layout data or LayoutView of a PCell or ElementList

The Layout data or LayoutView of a PCell or ElementList

layers: list

List of layers that need to be inspected. If it is empty then all layers are inspected.

angle_threshold: float

An extra threshold for acute angles. For instance, if angle_threshold=0.5, angles that are smaller than 89.5 and bigger than 270.5 will be returned instead of the default <90 and >270.

Returns:

collection: defaultdict

A dictionary with, per layer, a nested list of acute angles (degrees) and the points that make up those angles. For instance: {TECH.PPLAYER.WG.CORE: [(acute point, (previous point, next point), acute angle in degrees), …]}

Examples

import ipkiss3.all as i3

class SharpShape(i3.PCell):
    class Layout(i3.LayoutView):
        def _generate_elements(self, elems):
            elems += i3.Boundary(
                layer=i3.Layer(0),
                 shape=[(0,0), (40,30), (10,30), (-10,10), (20,20), (0,0)])
            return elems

cell = SharpShape()
cell_lay = cell.Layout()

print(i3.get_acute_angle_points(cell_lay, layers=[i3.Layer(0)]))
print(i3.get_acute_angle_points(cell_lay.layout))

cell_lay.visualize()
../../../_images/ipkiss3-pcell-layout-operations-get_acute_angle_points-1.png