Masoud Posted February 25, 2019 Share Posted February 25, 2019 Hi; 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. Angles.hip Quote Link to comment Share on other sites More sharing options...
Mark01 Posted February 25, 2019 Share Posted February 25, 2019 cross product Quote Link to comment Share on other sites More sharing options...
Masoud Posted February 25, 2019 Author Share Posted February 25, 2019 4 minutes ago, MilesS1 said: cross product Hi; Unfortunately, I'm not good at math so I don't know how to use cross product. Quote Link to comment Share on other sites More sharing options...
Mark01 Posted February 25, 2019 Share Posted February 25, 2019 That's fine, check this out: https://www.google.com/search?q=cross+product&ie=utf-8&oe=utf-8&client=firefox-b-ab Quote Link to comment Share on other sites More sharing options...
Masoud Posted February 25, 2019 Author Share Posted February 25, 2019 2 hours ago, MilesS1 said: That's fine, check this out: https://www.google.com/search?q=cross+product&ie=utf-8&oe=utf-8&client=firefox-b-ab I checked it, but Cross Product gives me a new vector that is perpendicular to two other vectors, which is not what I need. Quote Link to comment Share on other sites More sharing options...
acey195 Posted February 25, 2019 Share Posted February 25, 2019 (edited) 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 February 25, 2019 by acey195 Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted February 26, 2019 Share Posted February 26, 2019 Hi, yes with the cross product you can create a rotation axis (check file). AnglesRot.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted February 26, 2019 Share Posted February 26, 2019 since your vectors V1 and V2 are already normalized, to get your desired vector V just get the average and normalize again, you'll get the middle vector v@V = normalize(avg(V1,V2)); 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.