Skip to content

Commit

Permalink
use epsilon (#12192)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Diez <[email protected]>
  • Loading branch information
ddiezrod and Daniel Diez authored Mar 15, 2024
1 parent a82f1b0 commit 115aa76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kratos/utilities/intersection_utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -740,9 +740,9 @@ class KRATOS_API(KRATOS_CORE) IntersectionUtilities

// Compute the intersection point and check if it is inside the bounds of the segment
const double r = a / b;
if (r < 0.0){
if (r < 0.0 - epsilon){
return 0; // Intersection point lies outside the bounds of the segment
} else if (r > 1.0) {
} else if (r > 1.0 + epsilon) {
return 0; // Intersection point lies outside the bounds of the segment
}
rIntersectionPoint = rLinePoint1 + r * line_dir;
Expand Down

0 comments on commit 115aa76

Please sign in to comment.