You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
according to a formula for dot product:
a_vec dot b_vec = a_mod * b_mod * cos(angle_a_b)
TriMesh::cornerangle misses a_mod * b_mod and the code should be:
inline float cornerangle(int i, int j)
{
using namespace ::std;
if (unlikely(faces.empty())) need_faces();
const point &p0 = vertices[faces[i][j]];
const point &p1 = vertices[faces[i][NEXT_MOD3(j)]];
const point &p2 = vertices[faces[i][PREV_MOD3(j)]];
// new lines down from here
const point &v1 = p1 - p0;
const point &v2 = p2 - p0;
const float m = len(v1) * len(v2);
// return line is replaced
return acos(v1.dot(v2) / m);
}
The text was updated successfully, but these errors were encountered:
according to a formula for dot product:
a_vec dot b_vec = a_mod * b_mod * cos(angle_a_b)
TriMesh::cornerangle misses a_mod * b_mod and the code should be:
inline float cornerangle(int i, int j)
{
using namespace ::std;
// new lines down from here
const point &v1 = p1 - p0;
const point &v2 = p2 - p0;
const float m = len(v1) * len(v2);
// return line is replaced
return acos(v1.dot(v2) / m);
}
The text was updated successfully, but these errors were encountered: