Skip to Content.
Sympa Menu

cgal-discuss - core dump when using Segment_2<K>.has_on with point

Subject: CGAL users discussion list

List archive

core dump when using Segment_2<K>.has_on with point


Chronological Thread 
  • From: "Thomas Zangl - Home" <>
  • To: <>
  • Subject: core dump when using Segment_2<K>.has_on with point
  • Date: Mon, 11 Jun 2007 18:41:11 +0200


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,
--
----------------------------------------------------------------
,yours Thomas Zangl, Bakk.rer.soc.oec. -

-
- Freelancer - IT Consulting & Software Development -
- Student of Software Development-Economy (Master) -



Archive powered by MHonArc 2.6.16.

Top of Page