mirror of https://github.com/CGAL/cgal
fix intersection test in case no vertex is on bounded side
This commit is contained in:
parent
d797f6a538
commit
6b0067f7ef
|
|
@ -27,6 +27,7 @@
|
|||
#include <CGAL/Iso_rectangle_2.h>
|
||||
#include <CGAL/Segment_2_Segment_2_intersection.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
#include <CGAL/Segment_2_Iso_rectangle_2_intersection.h>
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -324,6 +324,7 @@ check_no_intersection (L(p(0, 0), p(10,10)), L(p(8,7), p(1, 0)));
|
|||
check_intersection<T>(Rec(p( 0, 0), p(3, 3)), T(p( 1, 1), p( 2, 1), p(1, 2)));
|
||||
check_intersection<P>(Rec(p( 0, 0), p(1, 1)), T(p( -1, 0), p( 0, 0), p(0, -1)));
|
||||
check_intersection<P>(Rec(p( 0, 0), p(1, 1)), T(p( 0, 0), p( -1, 0), p(0, -1)));
|
||||
check_intersection<Pol>(Rec(p( 100, 100), p(200, 200)), T(p(150, 50), p(250, 170), p(50, 170)));
|
||||
}
|
||||
|
||||
void run()
|
||||
|
|
|
|||
Loading…
Reference in New Issue