Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: Flipping inside a triangulation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: Flipping inside a triangulation


Chronological Thread 
  • From:
  • To:
  • Subject: Re: [cgal-discuss] Re: Flipping inside a triangulation
  • Date: Mon, 13 Oct 2008 22:44:51 MET

Hello again folks, and sorry for this e-mail series.

This time, I think I have been able to produce a minimal code which throws an
error I really don't understand. As you can see, I just generate a bunch of
random points. I insert them in a triangulation and, from time to time, I try
to
flip one of the faces. I check for the face and the adjacent one not to be
infinite. The T.flip() should keep the underlying data structure organized.
Nevertheless, it very shortly produces an error regarding the orientation of
indices in the faces. Any comments?

Best,

Daniel

The code:

#include <CGAL/Triangulation_2.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_euclidean_traits_xy_3.h>
#include <CGAL/point_generators_2.h>
#include <CGAL/algorithm.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;

typedef CGAL::Triangulation_2<K> Triangulation;

typedef Triangulation::Point Point;
typedef Triangulation::Vertex_handle Vertex_handle;
typedef Triangulation::Face_handle Face_handle;

typedef CGAL::Creator_uniform_2<double,Point> Creator;

int main(int argc, char * argv[]) {
std::list<Point> P;

CGAL::Random_points_in_square_2<Point,Creator> g(1.);
CGAL::copy_n( g, 1000, std::back_inserter(P));

Triangulation T; // (L.begin(),L.end());

int i=1;
for(std::list<Point>::iterator Pit=P.begin();
Pit!=P.end(); Pit++) {
Vertex_handle v=T.insert(*Pit);
i++;
if((i>50) && (i % 10 == 0)) {
Face_handle f=v->face();
int indx = f->index(v);
if ( T.is_infinite ( f ) ) continue;
Face_handle n = f->neighbor(indx);
if ( T.is_infinite ( n ) ) continue;
std::cout << i << std::endl;
T.flip(f,indx);
}
}

return 0;
}


--------------------------------------------------------------------------
Mensaje enviado mediante una herramienta Webmail integrada en *El Rincon*:
------------->>>>>>>> https://rincon.uam.es <<<<<<<<--------------





Archive powered by MHonArc 2.6.16.

Top of Page