Jump to content
Sign in to follow this  
wreath

Clustering Objects individually

Recommended Posts

Hi guys i would like to cluster my objects individually right now it clusters all the nearby pieces that not even the same object (no connectivity) is that a way to solve this without using for each ?

thanks!

Cluster Problem.hip

prob.jpg

Edited by wreath

Share this post


Link to post
Share on other sites

You can cluster per piece by making sure copy numbers are matching between primitives and cluster points.

image.png.9b6a9dd7af71a6e45f13d65236d83acd.png

// primitive wrangle
int pts[] = nearpoints(1, v@P, 1.0);

i@cluster = -1;
foreach(int pt; pts){
    if(point(1, 'copynum', pt) == i@copynum){
        i@cluster = pt;
        break;
    }
}

 

voronoi_per_piece.hipnc

  • Thanks 2

Share this post


Link to post
Share on other sites
12 hours ago, bunker said:

you could just separate the 2 pieces before the rbdcluster SOP:
Cluster_Problem_2.hiplc
or you can make your own clusters:
Cluster_Problem_3.hiplc

 

3 hours ago, konstantin magnus said:

You can cluster per piece by making sure copy numbers are matching between primitives and cluster points.

image.png.9b6a9dd7af71a6e45f13d65236d83acd.png


// primitive wrangle
int pts[] = nearpoints(1, v@P, 1.0);

i@cluster = -1;
foreach(int pt; pts){
    if(point(1, 'copynum', pt) == i@copynum){
        i@cluster = pt;
        break;
    }
}

 

voronoi_per_piece.hipnc

Thanks a lot for the setups guys those will do that job! cheers

Share this post


Link to post
Share on other sites
15 hours ago, konstantin magnus said:

You can cluster per piece by making sure copy numbers are matching between primitives and cluster points.

image.png.9b6a9dd7af71a6e45f13d65236d83acd.png


// primitive wrangle
int pts[] = nearpoints(1, v@P, 1.0);

i@cluster = -1;
foreach(int pt; pts){
    if(point(1, 'copynum', pt) == i@copynum){
        i@cluster = pt;
        break;
    }
}

 

voronoi_per_piece.hipnc

Konstantin hi again i need a bit more help on the file and did not wanted to create a new topic

How can I create a new name attribute based on those created clusters just like the "cluster sop" does ? Because right now if i send these to a dop sim its recognized as individual chunks instead of clusters..

Share this post


Link to post
Share on other sites
7 hours ago, wreath said:

How can I create a new name attribute based on those created clusters

Add this before the break:

s@name = 'cluster_' + itoa(pt);

 

  • Like 1

Share this post


Link to post
Share on other sites
14 hours ago, konstantin magnus said:

Add this before the break:


s@name = 'cluster_' + itoa(pt);

 

Thanks a lot!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×