Suppadech Yaemprai
Suppadech Yaemprai

Reputation: 11

!Clipper library Line polygon use offset How it Union

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

Upvotes: 1

Views: 809

Answers (1)

Angus Johnson
Angus Johnson

Reputation: 4643

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);
  }

Upvotes: 2

Related Questions