# Geometry Nodes - Centers of Bounding Boxes

Hello everyone,

I have a group of bounding boxes around some mesh islands.
My goal is to find the center of each individually and create a point cloud, where each point is positioned at one of the centers.

You could say, that what I try to achieve, is to find a dynamic “origin” of each mesh island at the center of it.

My approach is, to create “Points” with the amount of the domain size and set the position to the position of the bounding boxes. But my best result was, to have a point at each corner-point of the bounding boxes. (I tried attribute statistics, and accumulate field also)

Greetings, Mech

I found a solution myself. As you can see in the center of the nodegraph.

I realize “expand” the instances to the bounding boxes with 8 points each, store the mean instance position in each point (accumulate divided by 8).
Then I can sample the points with an “Index * 8” to get the instance_pos for each of my “spawned points” (amount of the initial instances).

Hi mechandrius,
using the Bounding Box is a good approximation. But you might run into some problems depending on the mesh topology. A better way would be to use the center of mass.

For example if your mesh island is a triangle:

As you can see, the Bounding Box center isn’t really at the center of the triangle.

To calculate the center of mass, you could try something like this (assuming your mesh islands have faces):

2 Likes

Yes, this is an improvement, but how do I get to it from Instances (from a collection)? (maybe some instances have more than one mesh island)

Not sure if i understand this correctly, but you can realize the instances:

Blue circles indicate the objects, red ones indicate the center of the mesh islands → Suzanne and the snowman have multiple mesh islands as an example.

1 Like