Subtraction - others from first. What objects are permissible?

Hi all,

Recently I started using KLayout with much help from the tutorial at Washington Nanofabrication Facility. This software seems very powerful, but unfortunately I am not.

Ideally I would like to make an instance that is an array of polygons, then center that instance in a larger square and subsequently subtract the instanced array from the square. However I have not been able to do this. It is possible to subtract the centered array instance after doing Flatten Instances, but then subsequent edits of the polygons don't propagate to the centered array. Does anyone understand what I am missing? Is there a way to do what I want? It would make my mask designs very easy to adapt.

Probably this is the perfect example for a macro, but I am not in possession of sufficient faculties...

Best wishes.


  • The command (as far as I have seen) only works on "flat"
    data (or what's at the present level of hierarchy).

    Are you trying to make "cutouts" which will be able to change
    later by editing the polygon and array, and have the cutouts change

    If it were me I wouldn't try too hard, just

    • copy the array and don't move it
    • select one of the two array instances, flatten it
    • make only the layer of the "square" valid, select the square
    • drag-select-add (shift-drag?) the polygons made by flattening
    • subtract

    Now you would have the "sieve" square, and still have the polygon
    array there to mess with. If you have to change them then it would
    be a couple of minutes repeated work?

    Another approach might be to add (or repurpose) a layer as a
    "negative" and use the DRC to do an ANDNOT and write a DB
    with that result, to pull back in. But there I have nothing more
    to offer in that vein, my scripting skillz are roughly zero.

  • Thank you for the input. So quick, what a great forum. I will do like you suggest.

    As per your question, yes exactly like that. And after that I make an array of the whole thing, aligned with the alignment marks. So it would have been VERY convenient to be able to change the basic shape and have it propagate through the whole hierarchy of instances. That way I would have known the only thing changed was the primitive shape itself. The whole idea with the instances and hierarchy is what made my knees soft when introduced to KLayout. :-)

Sign In or Register to comment.