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 : https://www.klayout.de/doc/programming/python.html , 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!

Comments

  • You could find API reference on https://www.klayout.de/doc-qt4/code/index.html and good example (Ruby, but not too different from Python) on https://github.com/klayoutmatthias/tf_import/. 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 = pya.CellView.active().layout()
    ly.top_cell().insert(pya.CellInstArray(ly.cell("A").cell_index(), pya.Trans(), pya.Vector(4000, 0), pya.Vector(0, 4000), 300, 300))
    

    Matthias

Sign In or Register to comment.