Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL Problem

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL Problem


Chronological Thread 
  • From: Monique Teillaud <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL Problem
  • Date: Thu, 27 Mar 2014 18:05:30 +0100

Hi,

I did not look into the details, but I can see that you are using
Cartesian_d<double> as a kernel, which is NOT recommended.

see
http://www.cgal.org/FAQ.html#inexact_NT
http://www.cgal.org/philosophy.html

best,
--
Monique Teillaud
http://www.inria.fr/sophia/members/Monique.Teillaud/
INRIA Sophia Antipolis - Méditerranée
Institut National de Recherche en Informatique et Automatique

Le 27/03/14 17:21, Ge Zhang a écrit :
Dear All,

I have figured out a workaround. With a bit experiment, I found that the
first 5 points are on the same plane, and the number of simplices becomes
incorrect after the 6th point is added. Based on this observation, I added a
small (1e-12) perturbation to the coordinates and the number of simplices
becomes correct! So my problem is solved. But still, I think this
demonstrates that the dD Delaunay package is not robust. It would be good if
someone can improve it.

Best,
Ge


From: Ge Zhang
Sent: Tuesday, March 25, 2014 1:49 PM
To:
''
Subject: CGAL Problem

Dear Sir or Madam,

I am not sure if I have made an error or if there is a bug in CGAL dD
Delaunay package. I need to do Delaunay triangulation of some
three-dimensional points and need to generalize the code to other dimensions
later. So I wrote this code:

///////////////////////////////////////////////////////////////////////////
double coord[] = {
15.987446522913068, 27.202164077804600, -1.7503256142623180,
15.783731654803892, 27.268252018459251, -1.7667168014850418,
15.366332754158634, 25.364059942735178, -0.12067529139448278,
14.798358756496864, 25.645272186454374, -0.24621719891310628,
14.416741390968623, 26.534931393517535, -0.90761123478229566,
12.653889524424551, 30.356776464885129, 1.6780311801981169,
20.141382962264476, 29.666174471723380, 0.81578848925181291,
15.255480206458079, 32.065555891106911, 0.14008969527418605,
15.856413673274881, 31.537804468497811, -0.50108136475224174,
19.537758401022533, 29.790220202824923, -0.21754568768545338,
19.418171028905622, 29.790007422401796, -0.38830723957693186,
20.081590302704605, 29.854788525235321, 0.73931846754153374,
16.096713953744956, 24.603235225447076, 1.9663067370703267,
15.057336655250380, 24.912757478035189, 2.7258085800022718,
19.717425535978570, 27.248357239016887, 3.5216075631300305,
20.340124881568187, 28.287915509305925, 2.9881740318160834,
18.440406384399445, 28.756603149763084, 5.7274305773261025,
19.732584195169082, 29.437336063389296, 4.1695063361795697,
16.615174375063219, 32.278894713132360, 2.6796054812782928,
19.411374934889903, 30.874452428442833, 2.6765292926211286,
15.527857372851596, 31.342303101257738, 4.4163514428924291,
17.970992967584714, 28.796276720304878, 5.9574834972343362,
14.323514965294358, 26.455018287900284, 4.7555968341210084,
12.748877146187398, 30.055258023558022, 3.4117720135679241,
};


#include <CGAL/Cartesian_d.h>
#include <CGAL/Kernel_d/Sphere_d.h>
#include <CGAL/Delaunay_d.h>
#include <iostream>
#include <list>

typedef CGAL::Cartesian_d<double> Kernel;
typedef CGAL::Delaunay_d<Kernel> Delaunay;
typedef Delaunay::Vertex_handle Vertex_handle;
typedef Delaunay::Simplex_handle Simplex_handle;
typedef Delaunay::Point_d Point;


int main()
{
Delaunay De(3);
for(int i=0; i<24; i++)
{
Point p(3, coord+i*3, coord+i*3+3);
De.insert(p);
}
std::list<Simplex_handle> simplices = De.all_simplices();
std::cout<<simplices.size();
return 0;
}
///////////////////////////////////////////////////////////////////////////

When I run this program on a Windows Server 2012 machine using Visual Studio
2012 compiler, the output I get is:
3

The problem is, if one plot the coordinates using MATLAB, one can clearly see
that those points form a polygon and the Delaunay triangulation should
consist of way more than 3 simplices. But why does the program only finds 3
simplices?

Best,
Ge Zhang












Archive powered by MHonArc 2.6.18.

Top of Page