File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ namespace
123123 const Real denom = edgedx * raydy - edgedy * raydx ;
124124
125125 // divide-by-zero means the segments are parallel
126- if (denom == 0 )
126+ if (std :: abs ( denom ) <= libMesh :: TOLERANCE * libMesh :: TOLERANCE )
127127 return -1 ;
128128
129129 const Real one_over_denom = 1 / denom ;
@@ -136,12 +136,13 @@ namespace
136136 const Real t = t_num * one_over_denom ;
137137
138138 // 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 )
140141 {
141142 // There's an intersection right on a vertex? We'll count it
142143 // if and only if it isn't a "double-intersection", if the
143144 // *next* edge in line is on the other side of our ray.
144- if (! t )
145+ if (std :: abs ( t ) <= libMesh :: TOLERANCE * libMesh :: TOLERANCE )
145146 {
146147 const Real prevdx = edge_pt0 (0 )- ray_target (0 ),
147148 prevdy = edge_pt0 (1 )- ray_target (1 );
You can’t perform that action at this time.
0 commit comments