I am using the Angus Johnson's Clipper Library in .NET/C# and I would like to do several concentric offset on a Polygon with the ClipperOffset class. (http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/_Body.htm).
I want to fill my polygon like the kangaroo (from Angus Johnson's Homepage).
I have written a function to do that, but it needs a big calculation time if I call it 10 times for example :
static public Polygon doOffset(Polygon p, double offset_nm)
{
// Offset to grow up the forbidden polygon
Polygons solution = new Polygons();
ClipperOffset co = new ClipperOffset();
co.AddPath(p, JoinType.jtRound, EndType.etClosedPolygon);
co.Execute(ref solution, offset_nm);
return solution[0];
}
Do you know a more efficient way to do that ? Thanks.