1

I want Draw Line polygon and Use Offset But it Unionenter image description here

acraig5075
  • 10,588
  • 3
  • 31
  • 50

1 Answers1

2

Suppadech, I suggest you pass two closed paths the the ClipperOffset object where the second path is oriented in the opposite direction to the first.

  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);
  }
Angus Johnson
  • 4,565
  • 2
  • 26
  • 28