Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Natural neighbor coordinates infinite loop

Subject: CGAL users discussion list

List archive

[cgal-discuss] Natural neighbor coordinates infinite loop


Chronological Thread 
  • From: "Funke, Daniel" <>
  • To: "" <>
  • Subject: [cgal-discuss] Natural neighbor coordinates infinite loop
  • Date: Fri, 4 Jul 2014 09:09:06 +0200
  • Accept-language: en-US, de-DE
  • Acceptlanguage: en-US, de-DE

Dear CGAL team,

I stumbled upon an infinite loop in the natural_neighbor_coordinates_2
function.

When running the attached example, I get into an infinite loop at
natural_neighbor_coordinates_vertex_2(). I attached a patch that fixes
the symptom of the problem, but I guess the cause is something else
entirely.

I would appreciate if someone could shed some light on the cause of the
issue.

Best regards
Daniel Funke
--- /usr/include/CGAL/natural_neighbor_coordinates_2.h.bak
+++ /usr/include/CGAL/natural_neighbor_coordinates_2.h.mod
@@ -202,11 +202,11 @@
 	   hit->first->vertex(dt.ccw(hit->second))->point(),
 	   p);
 
-      Face_circulator fc = dt.incident_faces(current, hit->first);
+      Face_circulator fc = dt.incident_faces(current, hit->first), done(fc);
       ++fc;
       vor[1] = dt.dual(fc);
 
-     while(!fc->has_vertex(prev))
+     while(!fc->has_vertex(prev) && fc != done)
        {
 	 ++fc;
 	 vor[2] = dt.dual(fc);

Attachment: testbed.tar.gz
Description: testbed.tar.gz



  • [cgal-discuss] Natural neighbor coordinates infinite loop, Funke, Daniel, 07/04/2014

Archive powered by MHonArc 2.6.18.

Top of Page