Offsetting open shapes with self intersecting lines
Boolean operations and offsetting library in Javascript
Brought to you by:
timo23414
I have data sets that consist of all open shapes that can contain self intersecting lines. What I mean by that is the following image.
The line goes from 0 to 1 to 2. But point 2 is on line 0-1 so the line 1-2 is overlapping 0-1. Offsetting this shape leads to some unexpected results. I have created an esbin example to demonstrate this.
https://esnextb.in/?gist=69f090e0f01c6a7a05a00ebd9d7987d9
Perhaps this behaviour by design, but I could really use a way to get around this problem.
I tested those paths at http://jsclipper.sourceforge.net/6.2.1.1/main_demo.html. Attached are the results. Is the result as desired in them?
Hi Timo, I'm sorry this issue was a mistake on my part. The npm clone of this project was I few versions behind, they just recently updated it. When I updated it it worked. Thanks for the response!
I also replicated this issue with the latest 6.4.2
My testing data is:
[[0,0, 10,0, 6,4, 10,0, 6,-4, 10,0]]
Offsetting delta is
1.000
Expected solution is an arrow shape, but a horizontal line actually.
Last edit: cuixiping 2022-11-03