Jump to content

vector flows along edge of primitive


CinnamonMetal

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

  • 2 weeks later...

 

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);

 

Link to comment
Share on other sites

  • 2 weeks later...
int vp3 = vertexpoint(0,@vrtList[1]);
int neighbours = (0,vp3);
v@alongEdge = vp1 - vp3;

The attribute vrtList is an array containing the primitive vertices.

When displaying the attribute alongEdge the vector doesn't flow along the vertices, in this case; vertices three to vertices one. Instead the vector is directed out from the third vertices, as it's not following the edge of the primitive ?

I hope this illustration helps.  The red points are vertices; the yellow arrow is the vector that flows along the edge of the primitive which is what I want to achieve between vertices. 

vectorAlongVertices.jpg

Edited by CinnamonMetal
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...