Expand fill of convex polygon

前端 未结 5 1400
你的背包
你的背包 2020-12-23 23:06

I have a convex polygon P1 of N points. This polygon could be any shape or proportion (as long as it is still convex).

I need to compute an

5条回答
  •  死守一世寂寞
    2020-12-23 23:53

    For each line segment of the original, find the midpoint m and (unit length) outward normal u of the segment. The corresponding segment of the expanded polygon will then lie on the line through m+n*u (where you want to expand the original by n) with normal u. To find the vertices of the expanded polygon you then need to find the intersection of pairs of successive lines.

提交回复
热议问题