GlennimusPrime Posted November 16, 2021 Share Posted November 16, 2021 Hi there, I'm trying to find a simplified or procedural approach to splitting a large number of points into a specific number of groups, without the same point being in one of the other groups. Let's say I have 1000 points and I'd like there to be 24 groups each with randomly selected points. I have somewhat of an idea, although I'm stumped at the splitting into groups part (to be fair this is most of what I need ) I start by creating a randomised ID based off @ptnum fit to 0-1 range Divide 1 by the number of required groups - in this case 24 = (0.041666) Next I need to be able to split the randomised id within 0.041666 into groups? Maybe I'm not thinking about this correctly? Hip file attached Random_Groups.hip Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted November 16, 2021 Share Posted November 16, 2021 9 hours ago, GlennimusPrime said: Hi there, I'm trying to find a simplified or procedural approach to splitting a large number of points into a specific number of groups, without the same point being in one of the other groups. Let's say I have 1000 points and I'd like there to be 24 groups each with randomly selected points. I have somewhat of an idea, although I'm stumped at the splitting into groups part (to be fair this is most of what I need ) I start by creating a randomised ID based off @ptnum fit to 0-1 range Divide 1 by the number of required groups - in this case 24 = (0.041666) Next I need to be able to split the randomised id within 0.041666 into groups? Maybe I'm not thinking about this correctly? Hip file attached Random_Groups.hip Hi, here is a hip file with may try. You can control amount of groups on a cluster points sop by "Clusters" parameter and randomization by adjusting "Seed" parm on the same node or on a Sort sop. Random_Groups_01.hipnc Quote Link to comment Share on other sites More sharing options...
Ziyad Posted November 16, 2021 Share Posted November 16, 2021 Hey, Here's an alternative way of achieving it using a single line of code and a partition SOP. Pretty similar to Victor's method! Random_Groups.hiplc Quote Link to comment Share on other sites More sharing options...
GlennimusPrime Posted November 17, 2021 Author Share Posted November 17, 2021 (edited) This is so great, thank you @vicvvsh. A nice simple system. I hadn't actually used or even heard of the cluster sop before! Seems like it may have many uses. Also thank you @Ziyad another use for the partition sop I wasn't aware of. Both simple and great examples. I was definitely thinking too deeply into a weird VEX solution here before, so these help out a lot. Cheers for the help all! Edited November 17, 2021 by GlennimusPrime Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.