Relation Node
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.
-
relate_node_screenshot.png 518 KB
- relate_node_demo.ndbx.zip 3.03 KB
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by lastvector on 21 Aug, 2024 08:57 AM
thank you John
I'm sure this will be helpful
gottfried