CinnamonMetal Posted April 6, 2018 Share Posted April 6, 2018 (edited) 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 April 10, 2018 by CinnamonMetal Quote Link to comment Share on other sites More sharing options...
Parboil Posted April 20, 2018 Share Posted April 20, 2018 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); Quote Link to comment Share on other sites More sharing options...
Atom Posted April 20, 2018 Share Posted April 20, 2018 And a quick way to visualize that is to assign the result to the normals. (v@N). Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted April 30, 2018 Author Share Posted April 30, 2018 (edited) 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. Edited May 2, 2018 by CinnamonMetal 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.