Skip to content

Commit 7dbf3a0

Browse files
authored
Bugfix when computing the pseudonormals
1 parent 4eefe27 commit 7dbf3a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

TriangleMeshDistance/include/tmd/TriangleMeshDistance.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,9 @@ inline void tmd::TriangleMeshDistance::_construct()
376376
this->pseudonormals_triangles[i] = triangle_normal;
377377

378378
// Vertex
379-
const double alpha_0 = std::acos(std::abs((b - a).normalized().dot((c - a).normalized())));
380-
const double alpha_1 = std::acos(std::abs((a - b).normalized().dot((c - b).normalized())));
381-
const double alpha_2 = std::acos(std::abs((b - c).normalized().dot((a - c).normalized())));
379+
const double alpha_0 = std::acos((b - a).normalized().dot((c - a).normalized()));
380+
const double alpha_1 = std::acos((a - b).normalized().dot((c - b).normalized()));
381+
const double alpha_2 = std::acos((b - c).normalized().dot((a - c).normalized()));
382382
this->pseudonormals_vertices[triangle[0]] += alpha_0 * triangle_normal;
383383
this->pseudonormals_vertices[triangle[1]] += alpha_1 * triangle_normal;
384384
this->pseudonormals_vertices[triangle[2]] += alpha_2 * triangle_normal;

0 commit comments

Comments
 (0)