Split one group based on ... space between objects?

   4658   5   2
User Avatar
Member
5 posts
Joined: March 2015
Offline
Hi all,
As usual, I'm a newbie.

So I'm trying to split a group of objects into two groups based on a distance or something better.


See here:


The Blue group have six balls close to each other, same for the Green group, So, to split the two groups, I want to use the space between them if possible.

What I tried is this:
I've connected a point SOP to Group1, then attached a foreach SOP to the point SOP, and plugged a Ray SOP to the each SOP inside foreach, since Houdini document stated that the Ray SOP needs points as input 1 to work.
But .. I couldn't figure out how to use it probably.

So, what can I do?

Attachments:
splittogroups.hipnc (71.4 KB)

User Avatar
Member
702 posts
Joined:
Offline
you can use the following in a group by Expression parm:



$BBX>.5

in this case it says any prim ( or point depending on mode ) that has an x position greater than the mid point of the bounding box will be grouped

then you can use the Combine tab to make the second group that is using the not equal button and selecting the first group

this would work for this case, but maybe not if you need multiple groups where only points within a tolerance of any direction are grouped together

Attachments:
group_boundingbox.hip (91.5 KB)

User Avatar
Member
5 posts
Joined: March 2015
Offline
Wow,Thanks, really good, for a second I thought this is it.. but um ..

this would work for this case, but maybe not if you need multiple groups where only points within a tolerance of any direction are grouped together
maybe is what I'm looking for.


I have this fractured cylinder, deleted the pieces inside it, so I have left and right pieces (maybe up and down in some cases), this solution (despite how clever it is) won't work for this specific case.
I've changed it to $BBY for testing.


Now, the left and the right parts could be wider (more pieces) or thinner (less pieces), maybe animated too. :cry:

So,
User Avatar
Staff
4159 posts
Joined: Sept. 2007
Online
Try Cluster Points (you'll likely need to tweak your control attributes) and Partition SOP with the rule set to grp_$CLUSTER (which will create a group for each value of the cluster attribute).

Attachments:
screenshot-area-2015-03-09-125215.png (14.0 KB)

I'm o.d.d.
User Avatar
Member
5 posts
Joined: March 2015
Offline
Soooo Close! :cry:

Thanks,
Yeah, Cluster might work, except that there is something buggy with the result.

I've connected a color SOP to the partition SOP for testing.
So on a frame, the left pieces become red, on the second frame, the right pieces are the red .. huh!

I need to play more with the cluster parameters and see.
User Avatar
Member
5 posts
Joined: March 2015
Offline
YESSS!
I fixed that problem with clusterpoint.
Thanks guys, you are the best!

Attachments:
untitled.png (43.3 KB)

  • Quick Links