Sometimes you need to know about the spatial relationship between two shapes. This is another one of those things a child can see instantly but a computer struggles with.
Given two shapes, A and B, there are five possibilities:
- They can overlap
- A can be entirely inside B
- B can be entirely inside A
- They can be separate
- They can be the same shape
The relate node can reveal this relation between any two shapes you give it. Demo and screenshot attached.
The node does assume both shapes are closed. Open shapes like curves will be treated as close shapes (just as they would if you tried to colorize them with a fill color). If you pass a straight line in it to one or both ports, it will falsely return a "same" reading.
The result is a string which begins with a digit (0 to 4) and a colon. If you want to feed this into a switch node, you can just carve off the first character.