Jump to content

Randomly Group Points Into Multiple Groups


Recommended Posts

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 :huh:)
 

  • 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

Link to comment
Share on other sites

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 :huh:)
 

  • 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

Link to comment
Share on other sites

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 by GlennimusPrime
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...