File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ namespace
123
123
const Real denom = edgedx * raydy - edgedy * raydx ;
124
124
125
125
// divide-by-zero means the segments are parallel
126
- if (denom == 0 )
126
+ if (std :: abs ( denom ) <= libMesh :: TOLERANCE * libMesh :: TOLERANCE )
127
127
return -1 ;
128
128
129
129
const Real one_over_denom = 1 / denom ;
@@ -136,12 +136,13 @@ namespace
136
136
const Real t = t_num * one_over_denom ;
137
137
138
138
// There's an intersection between the ray line and the edge?
139
- if (t >= 0 && t < 1 )
139
+ if (t >= - libMesh ::TOLERANCE * libMesh ::TOLERANCE &&
140
+ t - 1.0 < libMesh ::TOLERANCE * libMesh ::TOLERANCE )
140
141
{
141
142
// There's an intersection right on a vertex? We'll count it
142
143
// if and only if it isn't a "double-intersection", if the
143
144
// *next* edge in line is on the other side of our ray.
144
- if (! t )
145
+ if (std :: abs ( t ) <= libMesh :: TOLERANCE * libMesh :: TOLERANCE )
145
146
{
146
147
const Real prevdx = edge_pt0 (0 )- ray_target (0 ),
147
148
prevdy = edge_pt0 (1 )- ray_target (1 );
You can’t perform that action at this time.
0 commit comments