Subject: CGAL users discussion list
List archive
[cgal-discuss] compute_intersect_points does not respect parameter report_endpoints
Chronological Thread
- From: <>
- To:
- Subject: [cgal-discuss] compute_intersect_points does not respect parameter report_endpoints
- Date: Tue, 19 Oct 2010 22:29:12 +0200 (CEST)
Hi all,
I have this very simple, but failing, code:
#include <CGAL/Gmpq.h>
#include <CGAL/Cartesian.h>
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Sweep_line_2_algorithms.h>
#include <assert.h>
#include <list>
typedef CGAL::Quotient<CGAL::MP_Float> NT;
// typedef CGAL::Gmpq NT;
typedef CGAL::Cartesian<NT> Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef Traits_2::Curve_2 Segment_2;
typedef Traits_2::Point_2 Point_2;
int main(int argc, char** argv) {
const int kNumSegments = 2;
Segment_2 segments[kNumSegments] = {
Segment_2(Point_2(0, 0), Point_2(4, 4)),
Segment_2(Point_2(2, 2), Point_2(0, 4))
};
std::list<Point_2> intersection_points;
CGAL::compute_intersection_points(
segments,
segments + kNumSegments,
std::back_inserter(intersection_points),
/* report_endpoints = */ false);
assert(intersection_points.size() == 0);
return 0;
}
Clearly, the only single intersection point is (2,2), which is the first
endpoint on the second segment, but still it is reported as an intersection
point even though report_endpoints = false.
I'm using the CGAL 3.7 on my Mac (Snow leopard).
Am I doing something weird, or is it a bug?
- [cgal-discuss] compute_intersect_points does not respect parameter report_endpoints, johan, 10/19/2010
Archive powered by MHonArc 2.6.16.