Skip to content

Wrong result for open path offset (Version 1.3.1) #23

Description

@AndreasDekiert

The latest version fails in offsetting an open path and instead of returning one polygon, it will return two intersecting polygons. This worked with version 1.2.3.

The input:

result = {Path64@2566}  size = 4
 0 = {Point64@2569} "(-212183,1110139) "
 1 = {Point64@2570} "(212183,1110139) "
 2 = {Point64@2571} "(173959,-1113459) "
 3 = {Point64@2572} "(-173959,-1113459) "

The call:

Paths64 solution = new Paths64();
ClipperOffset clipperOffset = new ClipperOffset();
clipperOffset.AddPath(clipperPath, JoinType.Miter, EndType.Square);
clipperOffset.Execute(10000, solution);

The output:

solution = {Paths64@2581}  size = 2
 0 = {Path64@2613}  size = 6
  0 = {Point64@2616} "(222183,1100139) "
  1 = {Point64@2617} "(222183,1120139) "
  2 = {Point64@2618} "(-222183,1120139) "
  3 = {Point64@2619} "(-222183,1100139) "
  4 = {Point64@2620} "(202103,1100139) "
  5 = {Point64@2621} "(184953,-1056022) "
 1 = {Path64@2614}  size = 5
  0 = {Point64@2624} "(183959,-1113613) "
  1 = {Point64@2625} "(183959,-1045874) "
  2 = {Point64@2626} "(-183959,-1103459) "
  3 = {Point64@2627} "(-183959,-1123459) "
  4 = {Point64@2628} "(183789,-1123459) "

The expected output (i.e. the output of version 1.2.3):

solution = {Paths64@2373}  size = 1
 0 = {Path64@2551}  size = 8
  0 = {Point64@2553} "(222356,1120139) "
  1 = {Point64@2554} "(-222183,1120139) "
  2 = {Point64@2555} "(-222183,1100139) "
  3 = {Point64@2556} "(202009,1100139) "
  4 = {Point64@2557} "(164129,-1103459) "
  5 = {Point64@2558} "(-183959,-1103459) "
  6 = {Point64@2559} "(-183959,-1123459) "
  7 = {Point64@2560} "(183789,-1123459) "

Plotted with Excel:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions