Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] 4D Delaunay

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] 4D Delaunay


Chronological Thread 
  • From: Panagiotis Foteinos <>
  • To:
  • Subject: Re: [cgal-discuss] 4D Delaunay
  • Date: Wed, 25 Aug 2010 12:56:03 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=x5TkpCYRB8+saJ5IYxKrMAUYdGvdjsI4osSH4PmYHwF01zEvMH4BpyElGiFTQpTx9A gxi7auG51zF6hdF0ADUrpJA0LBoOxg02U1giCMZbQMJqkaVv5DrQVsqeQhX4RPVT5+Gp 5pgSMRnFVzgoqs3rtXydKLK1PuK0d/9sxJjUk=

Thank you Sebastien. It works now.

Regards,
Panagiotis

On Wed, Aug 25, 2010 at 11:17 AM, Sebastien Loriot (GeometryFactory) <sloriot.ml@gmail.com> wrote:
Panagiotis Foteinos wrote:
Thank you Sebastien.
I assumed that exact constructions were not necessary for the 4D kernels, simply because this is the case for the 3D kernels. I was wrong. The Cartesian_d<CGAL::Gmpq> kernel works fine now.
I guess exact constructions are not need, but exact predicates are.
Using Cartesian_d with double provides you inexact predicates.




I encountered, however, another error which sadly does not trigger any assertion, but rather it throws a segmentation fault.

Consider the following insertion sequence of 4D points:
   1st point:   6.8,    6.8,    6.8,    6.8
   2nd point:  6.8,    6.8,    6.8,   43.2
   3rd point:   6.8,    6.8,   43.2,   6.8
   4th point:   6.8,    6.8,   43.2,  43.2

The function DT.lookup() on the 4th point before its insertion throws a segmentation fault in the file CGAL/Handle_for.h (Line 125) .

There was a bug in the locate function.
The following patch fixes the problem (I have attached the patch file)

  --- ../Delaunay_d.h  2010-08-25 11:11:06.836440109 +0200
+++ include/CGAL/Delaunay_d.h   2010-08-25 11:11:41.704521236 +0200
@@ -820,10 +820,7 @@
  Simplex_handle f;
  this -> visibility_search(origin_simplex_,lp,candidates,dummy1,loc,f);
  this -> clear_visited_marks(origin_simplex_);
-  if ( f != Simplex_handle() ) return f;
-  typename std::list<Simplex_handle>::iterator it;
-  for(it = candidates.begin(); it != candidates.end(); ++it)
-    if ( contains(*it,x) ) return *it;
+  if ( f != Simplex_handle() ) return opposite_simplex(f,0);
  return Simplex_handle();
 }


Thanks for the bug report.

S.


I looked into the code and I observed that CGAL checks the points of at least one simplex. However, no simplex has to exist in the triangulation so far: only 3 points have been inserted. Also, no extra (i.e., more than it is needed to describe the actual triangulation) simplices are created (for example infinite simplices as is the case in 3D), and therefore I do not understand why CGAL finds a simplex to check. Maybe this observation is related to the segmentation fault occurred.

Any input? I am really wondering if someone could reproduce the error I get, i.e. a segmentation fault during the insertion of the 4th point... I am using version 3.6.1 .

Thank you in advance,
Panagiotis Foteinos



On Tue, Aug 24, 2010 at 8:39 AM, Sebastien Loriot (GeometryFactory) <sloriot.ml <http://sloriot.ml>@gmail.com <http://gmail.com>> wrote:

   Panagiotis Foteinos wrote:

       Hello.

       I am using the Delaunay_d class for the triangulation of 4D
       points. I am also using the Cartesian_d<double> kernel.


   Looking at the documentation here:

   http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Kernel_d_ref/Class_Cartesian_d.html#Index_anchor_736

   you'll see that you need to use an exact number type such as
   CGAL::Gmpq (in particular with collinear points) to compute safely
   the triangulation.


   S.

       I observed that the insertion of the following simple point
       sequence:

          1st point:  6.8,    6.8,    6.8,    6.8
          2nd point: 6.8,    6.8,    6.8,   43.2
          3rd point:  6.8,    6.8,   43.2,   6.8
          4th point:  6.8,    6.8,   43.2,  43.2

       triggers, during the insertion of the 4th point,  the following
       assertion:

          terminate called after throwing an instance of
       'CGAL::Assertion_exception'
          what():  CGAL ERROR: assertion violation!
          Expr: j != dim
          File: .../CGAL-3.6.1/include/CGAL/Kernel_d/HyperplaneCd.h
          Line: 103
          Explanation: HyperplaneCd::constructor: cannot use o to
       determine side.



       Is there a workaround? Why is this behaviour happening?


       Thank you,
       Panagiotis Foteinos



   --     You are currently subscribed to cgal-discuss.
   To unsubscribe or access the archives, go to
   https://lists-sop.inria.fr/wws/info/cgal-discuss




--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss





Archive powered by MHonArc 2.6.16.

Top of Page