XOR From Region Clipped to Ruler - Compare 2 portions of the 2 layouts


I'm using the XOR tool to compare 2 gds files but i don't want to compare the whole layout just 2 portions of the 2 layouts. I saw that there is the option Clipped to ruler but i could not see the layer differences on the klayout canvas. The Marker Database is showing the differences but when i click on them, i don't have the difeerences highlighted on canvas.

Do you have an idea on how to use the XOR Clipped to Ruler efficiently?


  • You mean you want to XOR two portions that are not overlapping, but at different locations?

    This is not possible with the current XOR tool. The "clipped by ruler" feature allows you to define regions that you want to XOR, but not two different regions to go into XOR as layouts A and B.


  • Hi Matthias, thanks for your response.

    I have opened the 2 layouts in the same panel and wanted to XOR 2 overlapping portions of the 2 layouts which the tool is doing if I'm not wrong.

    My problem is in the Output. The difference in layers is not showed.
    If i choose marker database as output it shows the difference but if i choose any other output i'm not getting the layers highlighted in the design.

  • Hi @Hamady,

    I just tried myself and it appears to be working.

    I used two layouts with some differences - one had a layer the other did not have and I changed some polygons. The files are attached.

    Then I loaded both into the same panel and used a box ruler to mark some area and used the following XOR options:

    The result is a new layout ("@3") that contains the differences from the marked box:

    So I think basically the feature is working. Is there something you do differently?

    Kind regards,


  • Hi @Matthias,

    Thanks again for your response.

    I have done all as the same as in your screenshot, maybe the problem is in my own testcase design.

    The XOR is the same as the other layouts, it's not showing the differences.


  • Hi @Hamady,

    So basically, differences are generated? I can't tell what differences there are actually. Do you expect anything else than layer 10/0?

    I did not use the "heal result shapes" option, maybe that makes a differences? I don't know of a bug there, but I maybe there is a problem related to this option?


  • Wait ... one more thing: did you draw four rulers to mark the rectangle?

    Actually you have to draw one ruler: if defines the area to clip by start and end point (the clip area is the ruler's bounding box). The "box" type ruler is handy for that purpose as it indicates the rectangle borders.


  • Hi @Matthias,

    Indeed, i drew four rulers. Didn't know about that, thanks. I will use just one ruler then to see if it will output what i want to see.

    I will also uncheck the "heal result shapes".

    Will let you know.


Sign In or Register to comment.