Intersect Subnetwork

john's Avatar

john

02 Dec, 2018 07:40 AM

When drawing in NodeBox I often need to find the point where two lines intersect. It surprises me that there is not a core node to do this - so I finally made one myself. (The compound node does intersections but only works with shapes.)

The intersect node (subnetwork) is very simple. It takes two lines as input and outputs the point where they intersect. If the two lines are parallel or coincident, it returns nothing. That's it.

As a demo I include a network that mimics a compass and straightedge construction to show how a decagon can be found inside a pentagon with an edge of the decagon sharing the middle of a pentagon edge. To find the exact position and radius of the decagon I need to take several lines connecting vertices of the pentagon; one intersection marks the center of the decagon, the other establishes its radius.

The resulting construction diagram is shown in the screenshot for this network. The two intersection points are marked with small circles.

I also include a screenshot of the intersect subnetwork. It employs a purely mathematical method involving matrix determinants - essentially a big equation full of nothing but multiplications and subtractions. (I also do a test to avoid division by zero errors.). NodeBox is particularly cumbersome when it comes to complex equations like this. What would take a few seconds to type in a normal language takes fifteen minutes of careful wiring to construct a sprawling network in NodeBox. The end result is either beautiful or ridiculous depending on your point of view.

If you make something cool using my intersect node, please consider sharing it in this forum.

John

Reply to this discussion

Internal reply

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

Attaching KB article:

»

Already uploaded files

  • decagon_screenshot.png 525 KB
  • interesect_network.png 525 KB
  • intersect_node_decagon_example.zip 3.23 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

10 Dec, 2018 01:47 PM
05 Dec, 2018 09:37 AM
02 Dec, 2018 07:40 AM
29 Nov, 2018 07:38 AM
20 Nov, 2018 11:21 PM