orbingol / NURBS-Python

Object-oriented pure Python B-Spline and NURBS library
https://onurraufbingol.com/NURBS-Python/
MIT License
640 stars 156 forks source link

Normal orientation #109

Open AnirudhaVyas opened 4 years ago

AnirudhaVyas commented 4 years ago

Hello

Using the geometric operation toolbox I was able to get the normal vectors, now I wanted to know how to calculate the orientations w.r.t. X,Y,Z axis respectively. I was using the formula theta = arccos((dot(n,x)/(norm(x)* norm(x)).

where n is the unit normal vector and x is [1, 0, 0] (for finding orientation along x-axis).

For n = [-.93 , 0 ,-0.34] , I am getting alpha as 159.91, which is correct but that angle can be in the second as well as third quadrant (while seeing it in X Z coordinate frame), so wanted to know on what basis this can be stated correctly to which quadrant it belongs