horizontal end segment of an open path gets reversed.
Boolean operations and offsetting library in Javascript
Brought to you by:
timo23414
See attached two images.
(Y is increasing from top to bottom)
// input
var subj_lines = [[{x:1, y: 2}, {x:2, y: 0}, {x:3, y: 1}, {x:4, y: 1}]]
var clip_polygons = [[]];
var cpr = new ClipperLib.Clipper()
cpr.AddPaths(subj_lines, ClipperLib.PolyType.ptSubject, false);
if (subjectOnly == undefined)
cpr.AddPaths(clip_polygons, ClipperLib.PolyType.ptClip, true);
var subject_fillType = ClipperLib.PolyFillType.pftNonZero;
var clip_fillType = ClipperLib.PolyFillType.pftNonZero;
var solution_polytree = new ClipperLib.PolyTree();
cpr.Execute(ClipperLib.ClipType.ctDifference, solution_polytree, subject_fillType, clip_fillType);
var solution_lines = ClipperLib.Clipper.PolyTreeToPaths(solution_polytree);
var solution_polygons = ClipperLib.Clipper.ClosedPathsFromPolyTree(solution_polytree);
// output, see last two points are swapped
// [[{x:1, y: 2}, {x:2, y: 0}, {x:4, y: 1}, {x:3, y: 1}]]
^ Timo, I created this ticket, apparently I forgot to log in before creating it.
Thanks. The issue is fixed in 6.4.2.1, which is coming soon.