Subject: CGAL users discussion list
List archive
[cgal-discuss] Re: How to find the minimum distance from an arbitrary point to a curve
Chronological Thread
- From: Tapadi <>
- To:
- Subject: [cgal-discuss] Re: How to find the minimum distance from an arbitrary point to a curve
- Date: Sun, 10 Mar 2013 05:06:54 -0700 (PDT)
If you are still searching for a solution :
- Distance [point , circle] = Distance [point, circle center] - circle
radius
- For the Distance [point, bezier curve], there is no close form as far as I
know. CG algorithms may get a good approximation, but I did not find a web
page talking precisely about point-curve distance queries. Here is the
solution I implemented myself a while ago, not perfect for precision nor for
computation time:
1. Discretize the Bezier curve into a polyline (using De Casteljau
algorithm, or more basically computing the points P(t) for many values of
t).
2. Optional: Store the polyline into a space partition structure (I used a
grid, but one can use a spatial tree, etc).
3. Look for the polyline segment nearest to the query point.
4. Return the distance between the point and the selected segment.
This is a quick-and-dirty solution, but it does the job. I hope it will help
you.
Then, there is *another question* I add to the topic: what CGAL package
should we use for replacing this temporary solution? Thanks in advance for
any hint :o)
Best regards,
Hugo Loi
PhD student at Inria - Maverick team
http://maverick.inria.fr/
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/How-to-find-the-minimum-distance-from-an-arbitrary-point-to-a-curve-tp4656534p4656884.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Re: How to find the minimum distance from an arbitrary point to a curve, Tapadi, 03/10/2013
Archive powered by MHonArc 2.6.18.