Relation Node

john's Avatar

john

21 Aug, 2024 12:01 AM

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.

  1. 1 Posted by lastvector on 21 Aug, 2024 08:57 AM

    lastvector's Avatar

    thank you John

    I'm sure this will be helpful

    gottfried

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • relate_node_screenshot.png 518 KB
  • relate_node_demo.ndbx.zip 3.03 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

Recent Discussions

06 Feb, 2025 01:37 AM
04 Feb, 2025 06:32 AM
04 Feb, 2025 05:04 AM
30 Jan, 2025 09:31 AM
30 Jan, 2025 09:08 AM

 

30 Jan, 2025 08:40 AM
24 Jan, 2025 07:50 AM
22 Jan, 2025 11:42 PM
21 Jan, 2025 09:43 AM
21 Jan, 2025 09:41 AM
21 Jan, 2025 09:36 AM