convert Basic.TEXT PCell to polygon

edited June 2016 in Python scripting

Hi,

first of all, thank you very much for that nice software and implementing the python scripting engine. It is really fun working with klayout.

As said in the title I would like to know how to convert a Basic.TEXT PCell to a polygon so that I can use it in a boolean operation. I the end I want to get an inverted text in the layout. The easiest way to do that using the GUI is to create a Basic.TEXT instance, flatten the top cell and then draw a box with the difference background-mode around the text object. What would be the equivalent using a script? I got a little further by converting the PCell in a static cell but still I cannot figure out how to do boolean operations between static cells and polygons (regions).

Regards, Christian

Comments

  • edited November -1

    I found a way to get what I want but it seems a bit cumbersome. I write the text to a new layer and use cell.top.begin_shapes_rec(layer) to convert all objects from that layer into a region. Then I can use the boolean operations on the regions and write the result back to the layer where I want the inverted text to appear.

  • edited November -1

    Hi Christian,

    thanks for this nice feedback :-)

    The Basic.TEXT PCell already has a "inverse" option. With this option, the text will be "holes". Did you try this option? It's available below the "magnification".

    Regards,

    Matthias

Sign In or Register to comment.