3

First of all I want to describe my problem: I have two 2D polygons (two sets of 2D point coordinates, polygonA and polygonB). I do not know if these two polygons collide or what is the distance between them. Moreover one of the polygons, say polygonA, is fixed, e.g. it is not allowed to translate or rotate it. Now I want to compute a position of polygonB such that 1. polygonA and polygonB do not collide 2. the summed squared distance between polygonA and polygonB is minimal In other words: I am looking for a position where polygonB "perfectly" lies on polygonA. Is there anybody who knows such an algorithm? Any ideas? Thank you very much for your help! Pia

4

1 回答 1

0

如果您要确定 polyB 是否完全位于 polyA 内,您需要做的就是确保 polyB 的所有边界点都位于 polyA 内。根据您的需要,您应该使用奇偶规则或非零缠绕规则来测试它。如果您只是尝试测试部分重叠,您只需要一个顶点位于另一个多边形内,在这种情况下,奇偶偶数或非零仍然是可行的方法。

于 2012-11-28T12:20:18.730 回答