Intersect Subnetwork

john's Avatar


02 Dec, 2018 07:40 AM

**UPDATE: I have now released a more comprehensive node that can find intersections between a line and another line, a bezier curve, or a general path (composed of multiple lines and curves). See posting for Intersect Path.**

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.


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
  • 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


? 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

16 Jun, 2022 05:30 AM
15 Jun, 2022 06:03 AM
06 Jun, 2022 01:07 PM
02 Jun, 2022 11:58 PM
30 May, 2022 07:48 AM


24 May, 2022 06:27 PM
20 May, 2022 04:12 PM
05 May, 2022 02:25 AM
03 May, 2022 04:46 AM
01 May, 2022 09:22 AM
18 Apr, 2022 09:01 PM