Jump to content

grouping points based on their proximity


Lukich

Recommended Posts

Hello! I have several points inside of the bounding object, and I need to create out of them a group based on their proximity to each other. (If they are further then a certain distance from the closest point, they're not a part of the group.) How can I do that? Should I write a script to do it or is there an easier solution?

Thanks a lot!

Luka

Link to comment
Share on other sites

This is inefficient, but it works:

1. Copy a metaball to each point.

2. Pipe the original point cloud into the first input of a magnetSOP and the metaballs into the second input of the same magnetSOP.

3. Set the magnet SOP to only change the colour, and increase it's scale values. This will basically change the colour of the points based on how many other points are in the area because of the accumulation of the metaball forces.

4. In a groupSOP, create a group with "Group by Expression" with a rule like $CR>.5, and all of the points with a red component with a value greater than .5 will be added to the group.

I use a method like this to control the opacity of particle driven smoke and fire effects - it makes the effect more opaque where there is a lot of it, and less opaque where it is sparse, ridding the simiulation of the "strays" that tend to happen periodically. Any orphaned particles that drift too far away from the group become completely transparent through their proximity (or lack thereof) to the crowd.

stu

Link to comment
Share on other sites

well, I tried it , but it's necessary to write an expression that will contain some kind of proximity attribute to group together the ones that are close to each other, but obtainig that kind of a variable in SOPs was the main problem...

on the related note - since the proximity pop deals with points wouldn't it be possible to extract the code from it and create a new SOP to do the same thing with points on on the geometry level?

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...