It looks like you're new here. If you want to get involved, click one of these buttons!
Hi
I have recently tried to detect gaps which can appear in our gds files (generated by gdsfactory) when we have an instance with a non-manhattan rotation (neither half-mahattan) to which we connect another instance.
The kind of artifacts we would get are gaps which are around 0.2-0.8nm long (DBU=1nm) as it can be seen in the following image:

The unzoomed image is:

For finding them, I tried the following script
LAYER = input(400, 0)
threshold = 0.005
merged = LAYER.merged
closed = merged.sized(threshold).sized(-threshold)
issues = closed.not(LAYER)
# Then output either to report or layer, whatever
However the issues layer I have at the end is not covering the gaps at all if they're too small, or weirdly if large enough (which works sufficiently for my use case I'd say)
Also a side effect of using this sized method is that the issues layer tend to appear here and there on the edges of my non-manhattan oriented polygons
From my understanding all of this happens due to the points snapping on the grid as precisely as possible and thus producing those artifacts.
Is there any other way I could try to detect them? I can provide more examples if needed.
Thanks