Sun Ray Posted February 4, 2011 Share Posted February 4, 2011 (edited) Hi, Kindly bear if this sounds amateurish. After scattering points on a grid, how do i calculate the distance between two points. If calculated, I presume, it would help me placing boxes on the grid so that they don't collide or intersect. I mean, after calculating the distance, if I give the width of the box lesser than half the distance, they should not collide. I would be much happier and thankful, if there is any other easier way to avoid intersection or collision. Cheers Sun Ray Edited February 4, 2011 by Sun Ray Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted February 4, 2011 Share Posted February 4, 2011 The Scatter SOP has an option to calculate the nearest neighbors. Turn it on to "Average of N nearest" and set the "Points To Consider" to 1. Now in the Copy SOP when your placing the boxes. Stamp a variable using the $ptarea attribute, and then scale the boxes with that variable. They will then be sized based upon their distance from each other. Quote Link to comment Share on other sites More sharing options...
Sun Ray Posted February 4, 2011 Author Share Posted February 4, 2011 Thank you so much Hop!! Cheers Sun Ray 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.