Skip to content

Commit ecdd389

Browse files
WIP-UPDATE: Threshold on isoparametric coordinates on mesh face adapted in method IsPointOnFace
1 parent 7da61c6 commit ecdd389

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/diffCheck/geometry/DFMesh.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,16 @@ namespace diffCheck::geometry
129129
double dot11 = v0v1.dot(v0v1);
130130
double dot12 = v0v1.dot(v0p);
131131

132-
// Compute barycentric coordinates
132+
// create u,v isoparametric mapping to the triangle where (u,v) = (1,0) if projectedPoint = v2, (u,v) = (0,1) if projectedPoint = v1 and (u,v) = (0,0) if projectedPoint = v0
133133
double invDenom = 1.0 / (dot00 * dot11 - dot01 * dot01);
134134
double u = (dot11 * dot02 - dot01 * dot12) * invDenom;
135135
double v = (dot00 * dot12 - dot01 * dot02) * invDenom;
136136

137137
// Check if point is in triangle
138-
if ((u >= -associationThreshold) && (v >= -associationThreshold) && (u + v <= 1 + associationThreshold))
138+
if ((u >= -associationThreshold / 100) && (v >= -associationThreshold / 100) && (u + v <= 1 + associationThreshold / 100))
139139
{
140140
// Check if the point is close enough to the face
141-
double maxProjectionDistance = std::min({(v1 - v0).norm(), (v2 - v1).norm(), (v0 - v2).norm()}) ;
141+
double maxProjectionDistance = associationThreshold * std::min({(v1 - v0).norm(), (v2 - v1).norm(), (v0 - v2).norm()}) ;
142142
if ((projectedPoint - point).norm() < maxProjectionDistance)
143143
{
144144
return true;

0 commit comments

Comments
 (0)