Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
for class Box, http://www.klayout.de/doc-qt4/code/class_Box.html
I would instead define "touches" as there being at least one coincident edge. e.g., you can have a small box touching a big box, but the points aren't common (if you define a point as a vertex / corner).
What I am really looking for is a test for overlapping & touching, for both Box and Polygon.
And as far as I can tell, Box.touches actually gives the result I desire (fortunately), but doesn't match the description.
For class Polygon, there is no overlap test, yet internally you must have one since you have shape iterators? (this is not critical for me... I have a work-around now)
Thank you very much,
thanks for pointing that out - I am aware that the wording is a bit sloppy. The idea of mine is that - if you include the border in the box - touching means the intersection between the two boxes is either a single point (single corner touching), a line (edges touching) or a non-empty box (overlap).
And yes, internally the polygon-polygon touching function is there (it's the basis of "interact") but not exposed as polygon methods. I take this ticket as a request for a "touches" method for Polygon and related classes. It should be easy to implement.
For now, the workaround is to use the Region's ability to select by interaction:
However, this workaround is only available for integer-type polygons.