Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Given a list of lines, and a test point, can I find the line index that is the nearest to the test point?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Given a list of lines, and a test point, can I find the line index that is the nearest to the test point?


Chronological Thread 
  • From: "Laurent Rineau (CGAL/GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Given a list of lines, and a test point, can I find the line index that is the nearest to the test point?
  • Date: Wed, 23 Jan 2013 11:07:36 +0100
  • Organization: GeometryFactory

Le lundi 21 janvier 2013 23:05:46 goshhukha a écrit :
> I have a list of lines ( or rather, a polyline
> <http://www.webopedia.com/TERM/P/polyline.html> ), and given a test point,
> I want to test the test point on that list of lines, so that I will get the
> line and the index of the line that is the closest to the test point?
>
> Is there anyway I can do this using existing cgal library, instead of doing
> it in a brute force manner, namely, looping through all the lines and test
> each line against the test point in the naive manner?

If your polylines are in 3D, I think that the AABB_tree package from CGAL is
the right tool to use. See the documentation here:

http://www.cgal.org/Manual/latest/doc_html/cgal_manual/AABB_tree/Chapter_main.html


--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/




Archive powered by MHonArc 2.6.18.

Top of Page