Corner Node

john's Avatar

john

08 Dec, 2020 11:27 PM

The attached node finds one of the four corners - or four edge midpoints - of a a rectangle or the rectangular bounds of a shape. Just plug in the shape, choose one of the eight options, and the node returns that point.

Very simple, but surprisingly useful. I will include it in the next release of my node library.

I have three types of node in library:

  • Something useful that can't be done in Nodebox - for which I include custom code in Python or Clojure
  • Something useful that is hard to do in Nodebox - which I provide as a subnetwork
  • Something useful that is easy to do in Nodebox - but still worth providing as a subnetwork

This corner node is the third type. It's not that hard to do, but it's very useful, and it's faster to just copy-paste it from the library and choose one of the eight settings that write it from scratch each time. Wrapping this function in a single node also keeps your overall code cleaner and easier to follow.

I've been surprised how often I've used this node over the last few months. Very handy for positioning titles or callouts , doing geometric drawings, labelling bar charts, setting the pivot point for rotations, etc.

Enjoy!

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

  • corner_screenshot.png 270 KB
  • corner_demo.zip 1.59 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 Sep, 2023 07:20 AM
05 Sep, 2023 08:40 PM
30 Aug, 2023 03:16 AM
19 Aug, 2023 03:22 AM
29 Jul, 2023 05:52 AM

 

28 Jul, 2023 10:53 PM
23 Jul, 2023 07:04 AM
14 Jul, 2023 03:05 AM
07 Jul, 2023 06:26 AM
05 Jul, 2023 11:44 PM
30 Jun, 2023 12:48 PM