!Clipper库Line多边形使用偏移如何联盟

时间:2016-11-23 04:01:16

标签: polygon offset clipperlib

我想绘制线条多边形和使用偏移但是联盟enter image description here

1 个答案:

答案 0 :(得分:2)

Suppadech,我建议你传递ClipperOffset对象的两条封闭路径,其中第二条路径的方向与第一条路径相反。

  int main()
  {
    Paths subj(2);
    Paths solution;
    subj[0] << IntPoint(10,10) << IntPoint(100,10) << IntPoint(100,100) <<  IntPoint(10,100);
    subj[1] << IntPoint(10,10) << IntPoint(10,100) << IntPoint(100,100) <<  IntPoint(100,10);
    ClipperOffset co;
    co.AddPaths(subj, jtSquare, etClosedPolygon);
    co.Execute(solution, 5.0);
  }