Jump to content

add information points closest to curve

Recommended Posts

I know one can do this with attribute transfer. But I would like to know how to do this in VOPs.


I have a random curve sitting close to a grid. I would like to assign a value to the grids points based off the distance from the curve. But in vops.


Also. Now that I think of it. Lets assume the grid had a mountain on it. Is there a way I can assign a value to the points based on their normals pointing to the curve. So for example if a normal is pointing straight at the closest point on the curve then it gets a 1. If it is pointing away it gets a 0.




Link to comment
Share on other sites

I don't know how to make in in vopsop but the process is simple.

Use the grid as input 1 and the curve as input 2

For each point on the grid go over all the points in the curve and calculate the distance.

Calculate the distance between the grid point and the first curve point.
Store the distance and point number in a variable.

Then continue with the other points on the curve.
calculate the distance.

compare the distance to the stored distance.

if i't smaller then the stored distance, overwrite the old distance and point number with the new ones.

Once you been over all the points in the curve you know the what point is closes to the current point in the grid.

Then copy desired attribute values from the saved curve point to the current grid point.
Repeat for each point in the grid.

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.

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