Is there any function or script to check whether two shapes have overlap?
Thanks a lot.
What exactly do you mean? Do you want to know whether two glyphs are overlapping (bumping into each other, so to speak)? Depending on what you want to achieve with the answer to your question, have you checked out the KernCrasher or Auto Bumper scripts by mekkablue?
Not for two glyphs, only need to check whether has overlap between two shapes.
The layer has a method
.intersections(). That will return a list of the position of those black intersections nodes. You can use this:
if Layer.intersections().count() > 0: # has intersections