1

I need to create an outline of a 2d polygon (I do that by scaling the vertices along the average of the edge normal's). But there is a problem when handling concave polygons because of the possible self intersections.

packman outline(green: original shape,purple:outline,white lines: normal's)

I've tried to fix those self intersections via the benley-ottmann algorithm and discarding the smallest part, but that doesn't preserve the original shape very well.

packman outline fixed

So I would like to know if there is a way that preserves the original shape better?

Spektre
  • 45,598
  • 10
  • 100
  • 347
GTull
  • 13
  • 4

1 Answers1

0

I would look into "polygon offsetting", the basic idea would be that for every vertex of the polygon you change that into a circle with a given radius, for every segment of the polygon you change that into a rectangle parallel to the original segment, and take the union of all resulting forms.