Replace Backdrop with Bound_box

john's Avatar

john

10 Mar, 2023 06:47 AM

I am doing a little cleanup work on my Cartan Node Library. Unless I hear a solid objection, I am going to deprecate one current node, backdrop, and replace it with a simpler node, bound_box. These changes will occur in the next 2.3 release of the library,

Backdrop took in a shape or group of shapes and returned it surrounded by a colored backdrop rectangle. I thought this would be useful, but over the last few years I only used it once. One problem with it was that I often did not want the shape grouped within the rect, and ungrouping sometimes caused a loss of structure. Since it's easy to make a backdrop on the fly without including the shape, this node added little value and was easy to do without.

I have, however, often found myself needing to create rectangles the same size or slightly bigger or smaller than a given shape or group of shapes (without the shape inside). Sometimes I need to draw a rectangle with proportions defined by some other geometry. Other times I need to use the rect with a compound or delete node. Or, if I ever do need to make a colored backdrop, a bound_box node would get me most of the way there in a single bound.

I have included a copy of this new bound_box node in the attached demo. It takes a path or geometry, adds or subtracts a margin, and returns a rect based on the bounds of the input, colored as a transparent outline. You can then recolor it if desired and either use it as the input to another node or combine and group it with other elements. A margin of x will add x pixels around all four sides of the rect, resulting a rect with dimensions (w+2x) times (h+2x). It works nicely with my corner node for finding the outer corners of shape.

Both of these nodes are dirt simple, and are easy to make on the fly. I finally decided to include bound_box in my library, though, because I found myself reinventing that wheel again and again. And I removed backdrop because it failed the same test.

Some may ask why deprecate nodes which, though not as useful as hoped, still work. I am trying to keep the size of my library to a manageable number of nodes. Each new node adds a cognitive load and makes it harder to find the node you're looking for. So my motto is "use it or lose it."

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

  • bound_box_screenshot.png 261 KB
  • bound_box_demo.ndbx.zip 1.11 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

26 Jan, 2025 02:09 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
21 Jan, 2025 02:00 AM
16 Jan, 2025 08:30 PM
15 Jan, 2025 06:37 AM
04 Jan, 2025 04:09 AM
03 Jan, 2025 05:32 PM