This patch adds a simple node to output the min and max of an axis aligned
bounding box for the geometry, including instances. The initial use case
I'm thinking about is a "bounding box boolean" node group, but I'm sure
there are others that wouldn't take too much imagination to come up with.
It's easy to imagine using this as a building block of more complex setups.
Details
Diff Detail
- Repository
- rB Blender
- Branch
- geometry-nodes-bounding-box-node (branched from master)
- Build Status
Buildable 12890 Build 12890: arc lint + arc unit
Event Timeline
| source/blender/nodes/geometry/nodes/node_geo_bounding_box.cc | ||
|---|---|---|
| 57 | I wasn't sure if this should go here or in the geometry set code. I think it's a bit more specialized, so I put it here, and we can always move it if it's helpful elsewhere. | |
Great idea!
Also, less importantly, it's nice for once to see a node that doesn't have a geometry output socket.
Actually, I feel like it would be nice and would totally make sense to actually output the bounding box as geometry. At least, from the name of the node I would expect that and usually that is what you need anyways.
Yes, good point. It can output both for when you need the vectors too. I think I'll wait until we have a node that creates a cube primitive then, so I can just reuse the code and scale it properly here.
hm, it make sense to make Boundbox output as a part of 'Object/Collection Info' Node?
Separating this functionality into a dedicated node makes sense to allow any (generated) geometry input and not require an object.
And adding this functionality to the object info node next to the dedicated bounding box node would be unnecessary in my opinion as it is not core functionality and can just as easily be achieved with the dedicated node.
For meshes it looks all good to me now!
Maybe a bit of a niche use-case but I tested it with points and volumes as well.
I'm not sure how it should work for volumes, but right now it doesn't at all. I think a node that is in the Geometry category should also work on all Geometry component types.
It should probably just make the bounding box around the grids regardless of the content.
For points I found an interesting behaviour for a negative radius. I think having the bounding box affected by point radius makes sense, but having it shrink with negative radii is a bit strange. I'm not sure why those are even a thing to be completely honest.
I feel like a radius should be capped at 0. But that behaviour has to be consistent with the rest of Blender.
Thanks! Yes, we have to decide if the radius attribute should be clamped! That can be a separate patch though, should be pretty simple. If not, the boundbox code for points can just use the absolute value of the radius.
Looking at the volume bounding box computation, it looks like it would require some refactoring to work in this situation, since the cache of the boundbox is stored at the object level right now.
I agree this node should support it, but I would probably want to talk to @Jacques Lucke (JacquesLucke) before adding that myself.


