Methods/functions list for Klayout library for a newbie

I am completely new to klayout with python. I can't seem to find basic methods list and introductory materials. After reviewing the material found : , it was still difficult for me start my design. Am I missing some other references beyond that page and searching the forums? For example, I would like to understand how to create a shape parametrically, I can't find that information in that page nor from searching the forum. Thanks in advance for your advice!


  • You could find API reference on and good example (Ruby, but not too different from Python) on Probably this discussion is most relevant to your task.

  • Thanks for response Eugene. From reading that post I didn't understand how to create a shape (say a sinusoid or a spiral) using a mathematical function. Also, from reading that post did I understand correctly that instancing objects with python in klayout isn't trivial? I would've thought theres a simple command like 'instance cell A into a 300x300 array' or something.

  • Sorry, I didn't try to create shapes with Python, so I may be wrong, but I think Path is what you should use. Indeed, you should use linear approximation of original formula.

  • What kind of programming language is "instance cell A into a 300x300 array" supposed to be?

    "Code" goes like this:

    ly =
    ly.top_cell().insert(pya.CellInstArray(ly.cell("A").cell_index(), pya.Trans(), pya.Vector(4000, 0), pya.Vector(0, 4000), 300, 300))


Sign In or Register to comment.