Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: Help getting triangles coordinates from Delaunay Triangulation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: Help getting triangles coordinates from Delaunay Triangulation


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Re: Help getting triangles coordinates from Delaunay Triangulation
  • Date: Thu, 03 Nov 2011 18:46:29 +0100

Look at this file:

include/CGAL/convex_hull_3_to_polyhedron_3.h

and more precisely to the operator().

I am doing exactly what you want.

Maybe you could use that function:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Convex_hull_3_ref/Function_convex_hull_3_to_polyhedron_3.html


Sebastien.


horstmann wrote:
Thank you so much for your help. Now I have the data I needed

I understand why we must consider only facets incident to an infinite cell,
and I have read your links, but I'm not sure how to do it correctly (sorry
about my ignorance in CGAL).

At the moment, I'm doing that:


std::vector< std::pair<Point,unsigned> > points; // aux for
triangulation
int **triangles; // Store resulting triangles indexes

for(i=0;i<NSPOINTS;i++)
points.push_back(
std::make_pair(Point(GRID[i].x,GRID[i].y,GRID[i].z),i));

// building Delaunay triangulation.
Delaunay dt( points.begin(),points.end() );

// memory allocation for triangles
triangles = (int**)malloc(nt*sizeof(int*));
for(i=0;i&lt;nt;i++)
triangles[i] = (int*)malloc(3*sizeof(int));

// Get &amp; Store the triangles
int n_triangles = 0,k1;
Delaunay::Finite_facets_iterator fit;
for (fit = dt.finite_facets_begin(); fit != dt.finite_facets_end();
fit++){
for(k1=1;k1&lt;=3;k1++)
triangles[n_triangles][k1-1] = fit->first->vertex(
(fit->second+k1)%4
)->info();
n_triangles++;
}

And works. So, how can I choose only the *surface triangles* among all the
finite facets?
I suppose, using "t.incident_cells" and "
cell_handle->index(t.infinite_vertex()) " and probably others functions
together with the Finite_facets_iterator, but I don't know how exactly...


Thank you so much again in advance!!

--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Help-getting-triangles-coordinates-from-Delaunay-Triangulation-tp3955310p3986844.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.16.

Top of Page