An algorithm for inflating/deflating (offsetting, buffering) polygons

后端 未结 12 2111
醉话见心
醉话见心 2020-11-22 12:58

How would I "inflate" a polygon? That is, I want to do something similar to this:

\"alt

<
12条回答
  •  旧巷少年郎
    2020-11-22 13:18

    One further option is to use boost::polygon - the documentation is somewhat lacking, but you should find that the methods resize and bloat, and also the overloaded += operator, which actually implement buffering. So for example increasing the size of a polygon (or a set of polygons) by some value can be as simple as:

    poly += 2; // buffer polygon by 2
    

提交回复
热议问题