Closest point on curve

I would like to find the closest point on a curve from a given point. The LowerDistanceParameter() property of the GeomAPI_ProjectPointOnCurve class will yield the closest orthogonal projection of the given point, however, it is not the closest point in my case. Is there a method to compute this?
Thanks, Chris

Rob Bachrach's picture

Check out Extrema_ExtPC

zhangzhigang824's picture

Hi,

As far as I know, the Extrema_ExtPC class will also yield the closest orthogonal projection of the given point, however, it is not the closest point in some case. The closest point must exist, but the Extrema_ExtPC maybe have no solution.

Can anyone give another method to computer the closest point.

Thanks very much!

Roman Lygin's picture

If I remember math well, the solution is either where a derivative is zero (i.e. orthogonal projection returned by Extrema_ExtPC) or range boundaries. Compute these two distances and compare with Extrema_ExtPC, and select minimum.

Hope this helps.
Roman

---
opencascade.blogspot.com - the Open CASCADE blog
www.cadexchanger.com - CAD Exchanger, your 3D data translator

zhangzhigang824's picture

Hi Roman,

That is a good idea, Thank you!