Jump to content
CinnamonMetal

vector flows along edge of primitive

Recommended Posts

How do you add a vector for a point that follows the edge of a primitive ? Suppose a point is on an edge, now I want a vector to point along the edge.  If I use set() I'm simply setting a vector for an axis, which I don't want.

 

Edited by CinnamonMetal

Share this post


Link to post
Share on other sites

 

You can use the neighbours() function.

int pt = 0;
vector pt_pos = point(0, "P", pt);
int neighbours[] = neighbours(0, pt);
vector neighbour_pos = point(0, "P", neighbours[0]);
vector along_edge = normalize(neighbour_pos - pt_pos);

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×