It looks like you're new here. If you want to get involved, click one of these buttons!
I'm writing a DRC script to interpret gds files. I need to find a set of polygons in a layer with the exact same shape, or polygons with multiple holes of the same shape. I know that they repeat every 100um and are aligned ortho, but the actual shape may vary between files I need to process. Is there a way to test polygons against themselves independent of location, or a way to test if is_filled, or something like that?
Comments
Hi @IanD,
you can iterate over the polygons of a layer using "each". This will give you a DPolygon object (see https://www.klayout.de/doc-qt5/code/class_DPolygon.html#k_1) which you can analyze using the provided methods.
Here is an example that classifies polygons:
For this example
this script gives 3 instances of "F" and one (the upper right one) which is a litte larger:
Matthias
awesome, Thankyou Matthias