1

I want to identify the gap between two non-overlapping polygons as a new polygon. As displayed in the image below, the comparison will be between polygons A and C, and the result should be the black area (gap) between them. For display purposes the gap area is highlighted with a red line. Any ideas on how to approach this problem ?

enter image description here

I tried using boolean clipping operation in c++, such as difference and exclusiveOr, but given that the polygon where non intersecting the results where not the gap between them.

Migko
  • 175
  • 2
  • 9
  • On this particular example it looks like all the vertices of the gap polygon are vertices of A and C, and a vertex of A is a vertex of the gap polygon if and only if it is close to the boundary of C. – Stef Feb 14 '23 at 09:55
  • That's a fair observation. Then If I get the distance between the closest vertices between the polygons I could find the gap's width. The length however might be more tricky. – Migko Feb 14 '23 at 10:22
  • yes. Most vertices of the gap are vertices of A that are close to a vertex of C, and vertices of C that are close to a vertex of A; but note that there is also a vertex of A which is not close to any vertex of C, but which is close to the boundary of C. And, there is an added difficulty because in that case, you need to "create" an extra vertex for the gap polygon at a point of the boundary of C where C doesn't have a vertex. – Stef Feb 14 '23 at 10:24

0 Answers0