Closest point on a polygon

Started by
5 comments, last by Dave Eberly 16 years, 11 months ago
I'm looking for a way to compute the closest point on a polygon to any point. This would be used many times, so I'm looking for some way to preprocess the polygon so that the search time can be reduced.
Advertisement
You can build the Voronoi regions corresponding to the edges of the polygon. Look at the related topic of "medial axes".
Are you assuming the point to lie on the plane of the polygon?
Quote:Original post by smitty1276
Are you assuming the point to lie on the plane of the polygon?


I am. The important question is whether the OP has this constraint in mind. If the problem is in 3D and the point is not necessarily on the plane of the polygon, the approach is nearly the same.
Yeah, this is meant to be used in 2d space. It seems that constructing a voronoi may be more work that it's worth. I'm currently using an algorithem that searches outwards from the point in a box manner, which is giving better performance than brute force. I don't know if there's any alternatives.
An alternative might be to do a series of closest-point-on-line-segment tests for each edge of the polygon and choose the closest point out of all the tests, and possibly precompute a bunch of information required for each test. But I haven't actually implemented any of these methods to know which one would be fastest.
Quote:Original post by Axiverse
Yeah, this is meant to be used in 2d space. It seems that constructing a voronoi may be more work that it's worth. I'm currently using an algorithem that searches outwards from the point in a box manner, which is giving better performance than brute force. I don't know if there's any alternatives.


Are your polygons convex?

This topic is closed to new replies.

Advertisement