Align objects individually within one mesh with Geo nodes

Hi, I`m looking a way to align objects with geometry nodes, the same way if I separate mesh by loose parts and then use align tools with min/max alignment. But I want to do this without separating the mesh into individual objects

Here is what I want do achieve

@zeroskilz would appreciate if you can help or point in the right direction

I suppose I have something to do with mesh island node and attribute statistic to evaluate min and maximum heights of vertices of each mesh part?

I’ll try help but attribute statistics won’t help you unless you use the Repeat Zone …experiments conducted by @moshus show that techniques using the sorting from points to curve are way more performant… (check out their Group Attribute Statistics node-group in the meantime.)

1 Like

You need to have the objects and the bottom plane as separate objects:

Basically you’re creating the Low-points, raycasting them onto the plane, then offsetting positions by island index:


LowPoints group (which relies on the weight sorting to find the lowest point using moshus’ technique):

Hope that helps.

3 Likes

Thanks for mentioning, but calling it my method is an not deserved honour.

As mentioned here in the thread, the idea for it is borrowed from an answer by Lukas Toenne. Only used it for my group node.

1 Like

Wow, tweak with curves and weight is something nonobvious. I wish I could somehow get more confident with those attribute shuffle. Anyway those solution worked extremely smoothly for my case. I had a mesh with 1M faces and 62K separate mesh islands inside, and it was aligned in a blink of an eye, whereas manually it would have been impossible