Lukich Posted November 3, 2004 Share Posted November 3, 2004 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 Quote Link to comment Share on other sites More sharing options...
edward Posted November 4, 2004 Share Posted November 4, 2004 Here's one method by way of the Proximity POP. proximity.hipnc.gz Quote Link to comment Share on other sites More sharing options...
stu Posted November 4, 2004 Share Posted November 4, 2004 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 Quote Link to comment Share on other sites More sharing options...
Lukich Posted November 4, 2004 Author Share Posted November 4, 2004 Thank you very much, guys! Tried both of them, but since my points aren't static I ended up using Stu's solution. That was another use for the Magnet SOp I've never heard of Thanks again! Quote Link to comment Share on other sites More sharing options...
stu Posted November 4, 2004 Share Posted November 4, 2004 I'm glad it worked for you, stu Quote Link to comment Share on other sites More sharing options...
George Posted November 5, 2004 Share Posted November 5, 2004 Would the Partition SOP help with this kind of grouping? Quote Link to comment Share on other sites More sharing options...
Lukich Posted November 5, 2004 Author Share Posted November 5, 2004 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? 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.