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

22 Nov, 2022 03:21 PM
22 Nov, 2022 10:40 AM
22 Nov, 2022 09:55 AM
20 Nov, 2022 12:06 PM
08 Nov, 2022 10:44 PM

 

05 Nov, 2022 08:40 AM
03 Nov, 2022 09:38 PM
24 Oct, 2022 11:32 AM
06 Oct, 2022 09:07 AM
05 Oct, 2022 02:22 AM
30 Sep, 2022 11:36 PM