fix hypotenuse
This commit is contained in:
parent
ba8a12ce5b
commit
d7341d03c7
@ -369,12 +369,14 @@ double DECL::EdgeAngle(int edge)
|
||||
if (dotprod > 1.f) dotprod=1.f;
|
||||
angle = acos(dotprod);
|
||||
// triangle corners
|
||||
int e2 = object.halfedge.next(edge);
|
||||
int e3 = object.halfedge.next(edge);
|
||||
P=vertex.coords(halfedge.v1(edge));
|
||||
Q=vertex.coords(halfedge.v2(edge));
|
||||
R=vertex.coords(halfedge.v2(halfedge.next(edge)));
|
||||
Q=vertex.coords(halfedge.v1(e2));
|
||||
R=vertex.coords(halfedge.v1(e3));
|
||||
// determine if angle is concave or convex based on edge normal
|
||||
W = 0.5*(P+Q)-R; // vector that lies in plane of triangle
|
||||
double hypotenuse = sqrt(W.x*V.x+W.y*V.y+W.z*V.z); // hypotenuse of right triangle
|
||||
double hypotenuse = sqrt(W.x*W.x+W.y*W.y+W.z*W.z + V.x*V.x+V.y*V.y+V.z*V.z); // hypotenuse of right triangle
|
||||
double length = sqrt((W.x+V.x)*(W.x+V.x) + (W.y+V.y)*(W.y+V.y) + (W.z+V.z)*(W.z+V.z));
|
||||
if (length > hypotenuse){
|
||||
// concave
|
||||
|
Loading…
Reference in New Issue
Block a user