# Geometry Nodes: How to get a field with individual object sizes inside a collection?

Is there a way how to get the individual bounding box size of each object inside a collection?

It's easy to get the bounding box size for an individual object, but I don't know how to do this for multiple objects inside a collection.

I don't want to get the whole collection bounding box, I need the local Y-length of each object.

Is there maybe already a field, where the data is stored?

• Unfortunately, this is only possible in a roundabout way. And Bounding Box is an object that consists of several values. Which values do you need exactly? Sep 7, 2022 at 10:20
• I just need the local y-length of every object. Sep 7, 2022 at 10:23
• Have a look at the Capture Instance Dimensions group in this answer Sep 7, 2022 at 12:45

## Find the length of one side of the Bounding Box

You can solve this as follows:

Here I first create a Bounding Box for each instance. Don't forget to activate the option Separate Children in the node Collection Info.

Then I use Realize Instances to convert these Bounding Boxes into a mesh.

A Bounding Box is a cuboid with 12 edges. One of the edges running on the local Y-axis always has the index $$1$$.

So I can conveniently filter this out here with Separate Geometry.

Note: Index $$1$$ always corresponds to the Y-axis, $$2$$ to the X-axis and $$3$$ to the Z-axis.

By converting this edge into a curve, the node Spline Length then directly returns the length of this former edge, and you have the value you are looking for.

Of course you can also calculate the length with the node Edge Vertices if you want to process the positions directly:

## Dimensions of the Bounding Box

Alternatively, you can also capture the lengths of all three local axes at the same time:

Here I first separate one of the edges on all three axes of each object (Thanks to @GordonBrinkman for the trick with comparing float values and epsilon!).

Then I capture the lengths of these edges and transfer them to the instances with Combine XYZ.

This way you have all three lengths available for each object separately.

### Bounding Box as Node Group

However, it would actually be much more convenient to implement the whole thing as a reusable node group that could be used in almost exactly the same way as the node Bounding Box.

Let's call this group "Instances Bounding Box".

This can be solved as follows:

The trick here is that I simply filter the first and the last point of the bounding box geometry and their positions.

However, since these are absolute positions, they must be set in relation to the current object.

The positions generated in this way are then exactly the values that the node Bounding Box would also supply.

(Blender 3.1+)

• Thank you for your solution. I'll take it and check if it fits my needs here. It's a part of a bigger tree. I'll drop a line, if I've still questions. @GordonBrinkmann You're basically right. Knowing all three values (x,y,z) is always good. Sep 7, 2022 at 12:33
• I can't believe I've just written the core of this answer all over again, with pretty much the same method. I must be going senile. Sep 7, 2022 at 13:04
• @quellenform Yep, good idea :D Sep 7, 2022 at 14:26

It's essential exactly the same way as quellenform does it, but maybe a bit more obvious way:

• Well done! But this time there is no upvote from me for once, because the question was actually: "individual object sizes" (plural!), so not only one object. ;-) ...or did I misunderstand something? Sep 7, 2022 at 11:11
• yep, i think you are right! Sep 7, 2022 at 11:28
• Thank you for your idea, Chris. Also nice. But yes, I need it for multiple objects. But we could also use the index node for the selection in your tree, right? Sep 7, 2022 at 12:29

This is a version as posted in a different context some time ago, tidied up a little.

It's a Capture Instance Dimensions group, which works by deleting all but the max and min vertices of realized Bounding Box instances on two branches, and using the fact that the vertex-indices of the resulting geometries correspond to the instance-indices in the original collection, to make the transfers:

Here shown used to pack a collection of randomly-scaled monkeys without realizing them:

• ...Please do not forget to save this node group as an asset this time :D Sep 7, 2022 at 15:49
• @quellenform :P ... but I don't truly understand it ... posting a Q of my own.. Sep 7, 2022 at 16:00