Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] core dump when using Segment_2<K>.has_on with point

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] core dump when using Segment_2<K>.has_on with point


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] core dump when using Segment_2<K>.has_on with point
  • Date: Tue, 12 Jun 2007 09:28:16 +0200


Hello Thomas,

Can you send me a minimal program so that I can reproduce
and hopefully fix it.

andreas



Thomas Zangl - Home wrote:
Hi!

I want to test if a given Point lies on a segment:

Code:
typedef CGAL::Point_2<Voronoi_K> Voronoi_Point;
typedef Voronoi_K::Ray_2 Voronoi_Ray;
typedef Voronoi_Triangulation::Segment Voronoi_Segment;
typedef std::vector<Voronoi_Point> VDPointContainer;

//---------------------------------------------------------------------
bool hasIntersectionSegmentWithPoints(Voronoi_Segment s, VDPointContainer&
points) {
std::cout <<"Has the Voronoi_Segment an intersection with a point?" <<
std::endl ;
VDPointContainer::iterator it;
for( it = points.begin(); it != points.end(); it++ ) {
cout << "Checking point " << *it << endl;
if (s.has_on(*it)) {
return true;
}
}
return false;
}

Output:
Has the Voronoi_Segment an intersection with a point?
Checking point 0.5 0.5
CGAL error: assertion violation!
Expr: !(i>s)
File: /home/TZi/CGAL-3.3/include/CGAL/Interval_nt.h
Line: 77
Explanation: Variable used before being initialized (or CGAL bug)
Aborted (core dumped)

Any idea what's wrong?

Best regards,




Archive powered by MHonArc 2.6.16.

Top of Page