Skip to content

Instantly share code, notes, and snippets.

@g2hollow
g2hollow / parray.lym
Created August 29, 2020 18:14
klayout marco pcell parray
import pya
import math
"""
This sample PCell implements a library called "MyLib" with a single PCell that
draws a Parray. This parametric array allows the user to modify the angle and
magnification of a shape along the rows and columns independently.
NOTE: after changing the code, the macro needs to be rerun to install the new
implementation. The macro is also set to "auto run" to install the PCell
@g2hollow
g2hollow / calc_area.lym
Last active November 10, 2023 14:15
klayout macro qt area calculator
import pya
class AreaCalculator(pya.QDialog):
"""
This class implements a dialog for calculating area of shapes
in a layout. The calculator adds up shapes in the currently
selected cell and below.
"""
def button_clicked(self, checked):
@g2hollow
g2hollow / spiral.lym
Last active December 16, 2020 12:20
klayout macro pcell sprial
import pya
import math
"""
This sample PCell implements a library called "MyLib" with a single PCell that
draws a sprial. It demonstrates the basic implementation techniques for a PCell
and how to use the "guiding shape" feature to implement a handle for the inner
and out radii of the spiral.
NOTE: after changing the code, the macro needs to be rerun to install the new