Reputation: 11
I want Draw Line polygon and Use Offset But it Union
Upvotes: 1
Views: 809
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