Jump to content

How could I set a point's normal, to a direction between two half-edges?


Recommended Posts


Using a point wrangle, I retrieved angle between two half-edges of a point:

int SelectedPoint = 1;

int SelectedPointHedge = pointhedge(0,SelectedPoint);
int AngleSrcPtnum = hedge_srcpoint(0,(hedge_presrcpoint(0, SelectedPointHedge)));
int AngleDestPtnum = hedge_dstpoint(0, SelectedPointHedge);

vector SelectedPointPos = point(0, "P", SelectedPoint);
vector pApos = point(0, "P", AngleSrcPtnum);
vector pBpos = point(0, "P", AngleDestPtnum);

vector V1 = normalize(pApos - SelectedPointPos); 
vector V2 = normalize(pBpos - SelectedPointPos);

f@angleRad = acos(dot(V1,V2));


How could I set(rotate) that point's normal, to a direction between two connected half-edges?

Thanks for helping.




Link to comment
Share on other sites

if you average the cross products of the vector of the edge directions of the corners: cross(normalize(pos1-pos2), {0,1,0}) and  cross(normalize(pos0-pos1), {0,1,0}), you should have your vector (or the anti vector not sure from the top of my head)

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