It looks like you're new here. If you want to get involved, click one of these buttons!
So I want to make a python script that also checks a GDS file for self-intersecting polygons. On the Klayout app, I have a DRC deck that uses the oddPolygon function to check for self-intersections. How can I translate that into Python. Does the API support that as a function? Trying my own sweep-line algorithm seems to give me different results to the KLayout checker. Help would be appreciated!
Edit: It should also find self-intersections (parts where they overlap) in paths like oddPolygon seems to do
Comments
HI @aarush,
Most DRC functions are basically method calls to "Region", "Edges", "EdgePairs" or "Texts" objects.
In case of "odd_polygon", the method call is "strange_polygon_check" (see here: https://www.klayout.de/doc-qt5/code/class_Region.html#k_293).
To mimic this check, construct a "Region" object with the layer you like to investigate and execute "strange_polygon_check".
Matthias
So then does something like this work? Or does it iterate over the layers wrong?
Thank you for all the help,
Aarush
No, that is wrong.
A region is already a full layer - you must not iterate over the cells.
You will need to start from a top cell instead.
This should work better:
Matthias
Thank you Matthias, this is now giving me the same output as the Klayout App!!!!
Best,
Aarush