Subject: CGAL users discussion list
List archive
- From: Efraim Fogel <>
- To:
- Subject: Re: [cgal-discuss] Intersection not being detected
- Date: Mon, 08 Feb 2010 18:04:03 +0200
Have you tried Exact_predicates_exact_constructions_kernel?
Unfortunately, you must use the exact construction kernel for this
operation, even though you are interested only in the evaluation of a
predicate (and not in the intersection itself). do_intersect() simply
calls intersection(), and returns true iff the intersection is not
empty, and intersection() naturally require an exact construction kernel.
breenmachine wrote:
> Hi, I've been debugging some code for a few hours now and finally have the
> problem boiled down to the fact that there is an intersection between 2
> polygons that is not being detected. I have a feeling I've done something
> stupid or misunderstood the do_intersect() function.
>
> Here is a quick example program that reproduces the problem I'm having. I
> know these polygons intersect because my original program draws them and the
> intersection is quite large. Does anyone know why do_intersect is returning
> 0? Thanks.
>
> #include <CGAL/Boolean_set_operations_2.h>
> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
> using namespace std;
> typedef CGAL::Exact_predicates_inexact_constructions_kernel Rep;
> typedef CGAL::Point_2<Rep> Point_2;
> typedef CGAL::Polygon_2<Rep> Polygon_2;
>
> int main()
> {
> Point_2 box[5] = {Point_2(1.775,3.925), Point_2(-4.075,3.925),
> Point_2(-4.075,9.725), Point_2(1.775,9.725)};
> Polygon_2 boxPoly = Polygon_2(box,box+4);
> Point_2 quad[5] = {Point_2(2.69,4.7), Point_2(0.91,2.4),
> Point_2(0.21,3.4), Point_2(1.75,5)};
> Polygon_2 quadPoly = Polygon_2(quad,quad+4);
> cout << do_intersect(quadPoly,boxPoly) << endl;
> }
>
--
____ _ ____ _
/_____/_) o /__________ __ //
(____ ( ( ( (_/ (_/-(-'_(/
_/
- [cgal-discuss] Intersection not being detected, breenmachine, 02/05/2010
- Re: [cgal-discuss] Intersection not being detected, Efraim Fogel, 02/08/2010
- [cgal-discuss] Re: Intersection not being detected, breenmachine, 02/08/2010
- Re: [cgal-discuss] Intersection not being detected, Efraim Fogel, 02/08/2010
Archive powered by MHonArc 2.6.16.