Prevent undefined points with NaN from producing floating point exception

This commit is contained in:
Simon Giraudot 2019-04-16 09:20:44 +02:00
parent 45c5ca911b
commit 65c29ff0fc
1 changed files with 1 additions and 1 deletions

View File

@ -384,7 +384,7 @@ struct L_p_visitor : public boost::static_visitor<
result_type
operator()(const typename K::Point_3& p) const {
typename K::Collinear_are_ordered_along_line_3 cln_order=K().collinear_are_ordered_along_line_3_object();
if ( cln_order(s1[0],p,s1[1]) && cln_order(s2[0],p,s2[1]) )
if (CGAL::Is_valid<typename K::FT>()(p.x()) && cln_order(s1[0],p,s1[1]) && cln_order(s2[0],p,s2[1]) )
return intersection_return<typename K::Intersect_3, typename K::Segment_3, typename K::Segment_3>(p);
else
return intersection_return<typename K::Intersect_3, typename K::Segment_3, typename K::Segment_3>();