Subject: CGAL users discussion list
List archive
[cgal-discuss] Order of points in the polyhedron constructed with convex_hull_3
Chronological Thread
- From: Илья Палачев <>
- To:
- Subject: [cgal-discuss] Order of points in the polyhedron constructed with convex_hull_3
- Date: Mon, 09 Feb 2015 08:48:02 +0300
- Envelope-from:
Hi,
There is a vector of 3D points, and the hull of them is constucted:
std::vector<Point_3> points = ...;
Polyhedron_3 hull;
CGAL::convex_hull_3(points.begin(), points.end(), hull);
After that I need to know which vertex in hull correspond to points[i] and vice versa.
Is there any API to set the initial ID of point/vertex before the construction of hull and then to get it after the construction?
The staightforward method is to look through the vector of vertices and find the closest vertex to the given point.
But this method needs O(N ^ 2) of time, or O(N * log(N)) if we do something like preliminary sorting the array of hull vertices in the lexicographical order.
But is there any natural way to do that?
--
Best regards,
Ilya Palachev
- [cgal-discuss] Order of points in the polyhedron constructed with convex_hull_3, Илья Палачев, 02/09/2015
- Re: [cgal-discuss] Order of points in the polyhedron constructed with convex_hull_3, Sebastien Loriot (GeometryFactory), 02/13/2015
Archive powered by MHonArc 2.6.18.