Let's say I want to use CGAL's Delaunay Triangulation.
I inserted a couple points and now want to retrieve the nearest neighbour of a point p
.
I now know that the way to do so would be to define a point n
n = triangulation.nearest_vertex(p)->point();
However, looking at CGAL's documentation of nearest_vertex
, this is not immediately clear to me as nearest_vertex
is also documented to take a Face_handle
- which I may not need to provide due to its default value, but about which no useful information is provided. Sure, it "may be used to initialize the location", but what does that actually mean and what are the options? And most importantly, where in the documentation can I find this information?
From here: Locate is implemented by a line walk. The walk begins at a vertex of the face which is given as an optional argument or at an arbitrary vertex of the triangulation if no optional argument is given.
This is particularly useful if you have a bunch of points you want to locate in the triangulation. You can sort the point along a Hilbert curve and locate each point using a face containing the closest vertex to the previous point to initialize the walk.