Bounding Box size

Hi, probably a silly question:
Is there a single component to give you the size of a Bounding box? this is what I am currently doing:
1.gh (17.5 KB)

Using a number param will convert a domain to its length.
Capture

4 Likes

thanks

It is also possible to use box properties and deconstruct the diagonal

Peacock has the Size component that does just that.

1 Like

Can I jump in and ask about how this works?

I see that each X, Y and Z is “one locally defined value”, but that it contains two number, A and B, and when you hook up a number node to that as you’ve done, the result is actually (A - B)… why is that and how do you extract A and B separately?

EDIT: Well, saw that you mentioned domain the comment, so apparently this is how you separate that one value into both of its parts…

image

An axis aligned box can be thought of in several ways. Rhino internally thinks of it as two points. One at the lower/bottom/front of the box and the other at the upper/top/back. So one point contains the lowest of the x, y, z coordinates while the other contains the highest.

Another way is to think of a box as three intervals, which is what is happening here. Each interval is associated with one of the three axes and it tells you on what part of the axis the box exists. In a way it’s the exact same numbers, just structured differently.

Imagine for example a sphere with radius 5 and centre point (2,4,6). The min/max coordinates of the box corners would be (-3, -1, 1) and (7, 9, 11), while the three intervals describing the exact same bounding box look like [-3, 7], [-1, 9] and [1, 11].

1 Like