Menu

#16 horizontal end segment of an open path gets reversed.

1.0
closed
nobody
None
2017-09-03
2016-12-03
Anonymous
No

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}]]
2 Attachments

Discussion

  • Ruwan Janapriya

    Ruwan Janapriya - 2016-12-03

    ^ Timo, I created this ticket, apparently I forgot to log in before creating it.

     
  • Timo Kähkönen

    Timo Kähkönen - 2017-09-03

    Thanks. The issue is fixed in 6.4.2.1, which is coming soon.

     
  • Timo Kähkönen

    Timo Kähkönen - 2017-09-03
    • status: open --> closed
     

Log in to post a comment.