Is there a similar method to determine the closest point on a polygon in general? It seems like we can follow exactly the same steps for any convex polygon, but a concave polygon would be slightly more complex because a point outside the shape could fall into multiple "sections". I suppose then we could simply measure the distance relative all such sections (e.g. the distance to both edges which are both "facing" the point), and take the minimum. A more brute-force approach that came to mind was to divide the polygon into triangles so that we can reduce the problem to this triangle method and then take the minimum of those. But my strategy described above seems far more efficient, so (assuming it is valid) I suppose I've answered my own question. And I imagine that this could be extrapolated to 3D as well, as described in the next slide.
motoole2
@Kalecgos There are several possible solutions. Triangulating your polygon and computing the minimum point to each triangle would definitely be one approach, even though this may not the most efficient strategy (as you mentioned). Even though a non-convex polygon may result in your query point falling "into multiple sections", checking the minimum distance to every vertex and every line segment would still work. One would need to determine whether the query point is also either inside or outside of the polygon; for this, we can perhaps perform an inside-outside query by casting a ray from our point and counting the number of times it hits an edge, as discussed in the lecture.
Is there a similar method to determine the closest point on a polygon in general? It seems like we can follow exactly the same steps for any convex polygon, but a concave polygon would be slightly more complex because a point outside the shape could fall into multiple "sections". I suppose then we could simply measure the distance relative all such sections (e.g. the distance to both edges which are both "facing" the point), and take the minimum. A more brute-force approach that came to mind was to divide the polygon into triangles so that we can reduce the problem to this triangle method and then take the minimum of those. But my strategy described above seems far more efficient, so (assuming it is valid) I suppose I've answered my own question. And I imagine that this could be extrapolated to 3D as well, as described in the next slide.
@Kalecgos There are several possible solutions. Triangulating your polygon and computing the minimum point to each triangle would definitely be one approach, even though this may not the most efficient strategy (as you mentioned). Even though a non-convex polygon may result in your query point falling "into multiple sections", checking the minimum distance to every vertex and every line segment would still work. One would need to determine whether the query point is also either inside or outside of the polygon; for this, we can perhaps perform an inside-outside query by casting a ray from our point and counting the number of times it hits an edge, as discussed in the lecture.