get_layer_elements
- ipkiss3.all.get_layer_elements(layout, layers=None)
Returns all the elements in a layout on a layer that’s in a given list of layers.
Similar to flat_copy but you can specify the layers for which you want the elements to be returned.
- Parameters:
- layout: Layout data or LayoutView of a PCell
The Layout data or LayoutView of a PCell.
- layers: list[Layer]
List of layers that need to be inspected. If it is empty (default) then all layers are inspected.
- Returns:
- elements: ElementList()
The elements in a layout on a layer that’s in a given list of layers.
Examples
import ipkiss3.all as i3 class SharpShape(i3.PCell): class Layout(i3.LayoutView): def _generate_elements(self, elems): elems += i3.Rectangle(i3.Layer(0), box_size=(10, 40)).transform(i3.Rotation(rotation=150)) elems += i3.Rectangle(i3.Layer(1), box_size=(10, 40)).transform(i3.Rotation(rotation=90)) elems += i3.Rectangle(i3.Layer(2), box_size=(10, 40)).transform(i3.Rotation(rotation=30)) return elems cell = SharpShape() cell_lay = cell.Layout() cell_lay.visualize() elements = i3.get_layer_elements(cell_lay, layers=[i3.Layer(0), i3.Layer(2)]) i3.LayoutCell().Layout(elements=elements).visualize()