0

I would like to calculate Non-Fit Polygon (NFP) for two convex polygons.

I have read the article below and found an algorithm (Algorithm 1, pp. 18, See also the picture). https://www.diva-portal.org/smash/get/diva2:699750/FULLTEXT01.pdf

Intuitively, this algorithm finds an NFP by moving one polygon (orbit polygon) around the other (fixed polygon), keeping the orbit polygon touching the fixed polygon but not intersecting (assuming both polygons don't rotate).

More concretely, It sorts the edges of the polygons by their angle, gets a polygon by connecting them as an NFP, and places the NFP based on a "reference point" of the orbit polygon. However, I could not understand how to determine the reference point. It seems that we could not set an arbitrary reference point because the polygons intersect if we choose the wrong reference point.

Any idea to choose a correct reference point?

kenmark
  • 1
  • 1
  • I don't intend to read the whole thesis. Isn't the NFP of two convex polygons their Minkowski sum ? –  Aug 11 '21 at 14:42
  • Thank you, Yves. As far as I know, it is true. That sort-based algorithm is just a simpler and old one (but other papers also introduce the one). However, still, I could not "place" the Minkowski sum to the fixed polygon. I tried pyclipper's MinkowskiSum over the two convex polygons, but the result is far from the polygon's location if I consider it as an NFP. What is my wrong? – kenmark Aug 11 '21 at 15:18
  • I tried Minkowski sum operation with (fixed polygon) + (-(orbit polygon)) above. – kenmark Aug 11 '21 at 15:36
  • I don't know what the convention is for the NFP. –  Aug 11 '21 at 16:51

1 Answers1

0

Reference point is the first point of orbiting polygon.

First You should move orbiting polygon in the way that point with max Y coodrinate of orbiting polygon touches point with min Y coordonate of fixed polygon (as long as You have convex polygons - in other case things get complicated).

CAD Developer
  • 1,532
  • 2
  • 21
  • 27