File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/diffCheck/segmentation Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -269,8 +269,9 @@ namespace diffCheck::segmentation
269269 for (auto normal : segment->Normals ){segmentNormal += normal;}
270270 segmentNormal.normalize ();
271271 double currentDistance = (faceCenter - segmentCenter).norm ();
272+ double currentAngle = std::abs (sin (acos (faceNormal.dot (faceCenter - segmentCenter))));
272273 // if the distance is smaller than the previous one, update the distance and the corresponding segment
273- if (std::abs (sin (acos (faceNormal.dot (segmentNormal)))) < angleThreshold && currentDistance < faceDistance)
274+ if (std::abs (sin (acos (faceNormal.dot (segmentNormal)))) < angleThreshold && currentDistance < faceDistance && std::abs ( 1 - currentAngle) < angleThreshold )
274275 {
275276 correspondingSegment = segment;
276277 faceDistance = currentDistance;
@@ -440,7 +441,7 @@ namespace diffCheck::segmentation
440441
441442 double currentDistance = (clusterCenter - faceCenter).norm () * std::abs (std::cos (clusterNormalToJunctionLineAngle))
442443 / std::min (std::abs (clusterNormal.dot (faceNormal)), 0.05 ) ;
443- if (std::abs (sin (acos (faceNormal.dot (clusterNormal)))) < angleThreshold && currentDistance < distance)
444+ if (std::abs (sin (acos (faceNormal.dot (clusterNormal)))) < angleThreshold && currentDistance < distance && std::abs ( 1 - std::sin (clusterNormalToJunctionLineAngle)) < associationThreshold )
444445 {
445446 goodMeshIndex = meshIndex;
446447 goodFaceIndex = faceIndex;
You can’t perform that action at this time.
0 commit comments