Closed rinntech-ak closed 4 months ago
I am seeing the same exception when offsetting in C#.
Here is some minimal code that reproduces the issue.
using Clipper2Lib;
var path = new Path64 { new Point64(100, 100) };
var paths = new Paths64() { path };
var clipperOffset = new ClipperOffset();
clipperOffset.AddPaths(paths, JoinType.Miter, EndType.Polygon);
var solution = new Paths64();
clipperOffset.Execute(-10, solution);
Expected Result: Empty solution (as in previous Clipper versions) Actual Result: Out of range exception.
regards, Richard
During using shrinking of paths I got range error in procedure BuildNormals. If pathlength is zero (len=0) fNorms[len-1] accesses element -1
My suggest for fix (works fine in my project): if len>0 then fNorms[len -1] := GetUnitNormal(fInPath[len -1], fInPath[0]);
Best regards Andreas