Skip to Content.
Sympa Menu

cgal-discuss - RE: [cgal-discuss] Triangulation_3 input

Subject: CGAL users discussion list

List archive

RE: [cgal-discuss] Triangulation_3 input


Chronological Thread 
  • From: <>
  • To: cgal <>
  • Subject: RE: [cgal-discuss] Triangulation_3 input
  • Date: Sun, 23 Nov 2008 17:16:51 +0000
  • Importance: Normal

Thank you for your response.
 
I am using the definitions I provided, however, I am not using GGAL::Random_points_on_sphere_3<CGAL_Point> to generate my point. I'm using my own function that returns a vector with inexact float/double values. These vectors point to a location on the unit sphere.
 
As I understand it, GGAL::Random_points_on_sphere_3<CGAL_Point> generates points IN a sphere, rather than only ON the surface of a sphere. I didn't test this yet, but what happens if you were to take these points generated by GGAL::Random_points_on_sphere_3<CGAL_Point>, normalized them (as a vector) and then fed them as points to triangulation.insert()? I would think that this would fail as well? I checked the ouput of my generator and it looks OK to me, I thought maybe it generated two identical points, but as far as I can tell, that's not the case.
 
I would really like a way of "fixing" this. Everything I've made so far depends on this really. I could use my hack of slightly adjusting the length of the generated vectors, but that would mean a great deal of trouble for the rest of my code. :(
 
So this is not a kernel problem?
 
Also, I don't understand however how side_of_oriented_sphere can fail though.
 
 
Thanks,
 
Peter.




From:
To:
Date: Sun, 23 Nov 2008 17:17:11 +0100
Subject: Re: [cgal-discuss] Triangulation_3 input


I don't know why exactly this is used however. Can some on explain this to me?

This is the empty ball condition used for defining the Delaunay triangulation. When inserting a new point p, all simplices S such that p is inside the circumsphere of S are searched. This is the test side_of_oriented_sphere. At the beginning, the method checks if the four vertices of simplex S are oriented positively. This should not fail with a Filtered kernel.

I guess I'm getting this error because my input is degenerate? Is there any way to fix this?

No, this reason would be valid if you were using an unfiltered kernel.

I'm using the following data structures:

I copy pasted your definitions (see code below), and I am unable to reproduce your problem. The program prints:

triangulation of 10000 points computed in 1.56 s

Are you sure you are really using these definitions?
-- 
Camille




---------------------------------------------------------------------------------
#include <CGAL/point_generators_3.h>
#include <CGAL/copy_n.h>
#include <list>

// YOUR DEFINITIONS START HERE
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Filtered_kernel.h>
typedef CGAL::Filtered_kernel<CGAL::Simple_cartesian<float> > KernelFloat;
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel KernelDouble;
typedef KernelFloat KernelActive;

#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Triangulation_hierarchy_3.h>
typedef CGAL::Triangulation_vertex_base_3<KernelActive> TVB;
typedef CGAL::Triangulation_hierarchy_vertex_base_3<TVB> THVB;
typedef CGAL::Triangulation_data_structure_3<THVB> TDS;
typedef CGAL::Delaunay_triangulation_3<KernelActive, TDS> DT;
typedef CGAL::Triangulation_hierarchy_3<DT> CGAL_Triangulation;
typedef CGAL_Triangulation::Point CGAL_Point;
typedef CGAL_Triangulation::Vertex_handle CGAL_VertexHandle;
typedef CGAL_Triangulation::Finite_vertices_iterator CGAL_FiniteVerticesIter;
typedef CGAL_Triangulation::Cell_handle CGAL_CellHandle;
// YOUR DEFINITIONS END HERE

#include <boost/progress.hpp>
#include <iostream>

#define N 10000

int main() {

CGAL_Triangulation triangulation;
typedef CGAL::Random_points_on_sphere_3<CGAL_Point> Generator;
std::list<CGAL_Point> collection;
CGAL::copy_n(Generator(1.), N, std::back_inserter(collection));
std::cout << "triangulation of " << N << " points computed in ";
{
boost::progress_timer timer(std::cout);
triangulation.insert(collection.begin(), collection.end());
}
return 0;
}



De nieuwe Hotmail maakt je leven nog makkelijker Wees er als eerste bij.



Archive powered by MHonArc 2.6.16.

Top of Page