Jump to content

calculating distance between points


Sun Ray

Recommended Posts

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

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.

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