Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Re: indices in CGAL::Delaunay_triangulation_2
- Date: Wed, 01 Dec 2010 17:14:04 +0100
schlady wrote:
Have a look here for a solution in 3D:
mr_hell wrote:
I have some troubles with filling CGAL::Delaunay_triangulation_2 with
vertices using info() in vertex handle.
Normally i use this kind of code
for(int i = 0; i < inp_pointscount; i++){
Delaunay2::Vertex_handle vert = triangulation.insert(DelaunayPoint2(inputpoints[i].x,inputpoints[i].y));
vert->info() = i;
}
but in this case each triangulation.insert call causes triangulation
recalculation, so i have inp_pointscount triangulation calls instead of
one, and it takes more time to get result.
and this code
triangulation.insert(pointlist.begin(), pointlist.end());
int count = 0;
for(Delaunay2::Finite_vertices_iterator v_it =
triangulation.finite_vertices_begin(); v_it !=
triangulation.finite_vertices_end(); ++v_it, count++) v_it->info() = count;
doesnt work correctly.
how to fill info() field, get correct results and call triangulation only
one time?
Hello list,
I am also having the same problem. I try to assign unique indices to the Delaunay vertices by using info().
Is there a way to fill the info() field by using the iterator version of the
insert method?
https://lists-sop.inria.fr/sympa/arc/cgal-discuss/2010-01/msg00004.html
An integrated solution may be in the next release of CGAL.
I also would like to know, does the vertex iterator preserve the same order
of vertices/points as I inserted them?
Points are first sorted using CGAL::spatial_sort documented here:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Spatial_sorting_ref/Function_spatial_sort.html
More details here:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Spatial_sorting/Chapter_main.html
S.
Cheers,
Jens
- [cgal-discuss] Re: indices in CGAL::Delaunay_triangulation_2, schlady, 12/01/2010
- Re: [cgal-discuss] Re: indices in CGAL::Delaunay_triangulation_2, Sebastien Loriot (GeometryFactory), 12/01/2010
Archive powered by MHonArc 2.6.16.