Sign in to follow this  

Closest point on a polygon

This topic is 3860 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

This topic is 3860 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this