Merge all shapes on each layer (for every layer)

edited May 2014 in General
Dear Klayot Community,
I am using Klayout to merge all the shapes in each layer of a gds file (with a single cell).

I am using the Merge Operation menu with source and results being the same file, overlap threshold 0, hierarchy flat, *one time for each layer in the gds file* (source layer 1, destination layer 1; source layer 2, destination layer 2, and so on). However, this require one commands for each layer to be processed, as well as for each gds file to be processed that way, leading to a long and error-prone process.

Is there a quicker command for this operation? Or is there a specific script documentation I could refer to?

Thank you very much in advance for any input, and thanks a lot for providing such easy and good layout editor!

Sincerely,
Alessandro

Comments

  • edited May 2014

    Hi Alessando,

    thank you :-)

    Your problem can be solved using a DRC script. The basic operation is that:

    input(1, 0).merged.output(1, 0)
    input(2, 0).merged.output(2, 0)
    ...
    

    You can even put that into a loop:

    # layers 1 to 100
    (1..100).each do |l|
       input(l, 0).merged.output(l, 0)
    end
    

    Please see http://www.klayout.de/doc/manual/drc.html for a documentation about the DRC feature.

    Matthias

  • edited November -1
    Dear Matthias,
    thanks a lot for your code - it worked like a charm :)

    Thank you very much for your time and your commitment to the tool!
    Alessandro
Sign In or Register to comment.