diff --git a/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h index 579d530acc2..3dd2a9fb9c5 100644 --- a/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -304,10 +305,18 @@ namespace CGAL{ namespace internal { typename K::Has_on_unbounded_side_2 unbounded_side=k.has_on_unbounded_side_2_object(); typename K::Construct_vertex_2 vertex=k.construct_vertex_2_object(); + for (int i=0;i<3;++i) if ( !unbounded_side( ir,vertex(tr,i) ) ) return true; for (int i=0;i<4;++i) if ( !unbounded_side( tr,vertex(ir,i) ) ) return true; + + typename K::Construct_segment_2 segment=k.construct_segment_2_object(); + for (int i=0;i<3;++i) + if ( do_intersect( + segment(vertex(tr,i),vertex(tr,(i+1)%3)), + ir, k) ) return true; + return false; } diff --git a/Intersections_2/test/Intersections_2/test_intersections_2.cpp b/Intersections_2/test/Intersections_2/test_intersections_2.cpp index 0d8c84f6964..512236d8933 100644 --- a/Intersections_2/test/Intersections_2/test_intersections_2.cpp +++ b/Intersections_2/test/Intersections_2/test_intersections_2.cpp @@ -324,6 +324,7 @@ check_no_intersection (L(p(0, 0), p(10,10)), L(p(8,7), p(1, 0))); check_intersection(Rec(p( 0, 0), p(3, 3)), T(p( 1, 1), p( 2, 1), p(1, 2))); check_intersection

(Rec(p( 0, 0), p(1, 1)), T(p( -1, 0), p( 0, 0), p(0, -1))); check_intersection

(Rec(p( 0, 0), p(1, 1)), T(p( 0, 0), p( -1, 0), p(0, -1))); + check_intersection(Rec(p( 100, 100), p(200, 200)), T(p(150, 50), p(250, 170), p(50, 170))); } void run()