Open path fixes
Boolean operations and offsetting library in Javascript
Brought to you by:
timo23414
Hi Timo,
As we have discussed in a previous ticket, there is a (or few) bug(s) in open paths. I've forked your code and incorporated some of the related commits from C# code base. Is there a way to contribute your project, for a new release with latest changes (including those open path fixes). Specially, are there any tests other than demo code to make sure new changes do not dbreak anything?
This is where the changes I've added located
https://github.com/japzi/jsclipper
The change log / or commits
https://github.com/japzi/jsclipper/commits/master
Demos
https://japzi.github.io/jsclipper/index.html?p=open_closed.html
Thank you!
Ruwan.
Hmm, couldn't find a way to edit the original ticket.
More changes or commits are available here, in 'easel' branch
https://github.com/japzi/jsclipper/commits/easel
Thank you
Ruwan
Hi Timo,
Do you think we could add these fixes to the original code? Atleast the open path fixes?
Also, how do you test your code before a release, just to avoid regression?
We are using your awesome library in www.easel.com
Thank you
Ruwan.
I have no timetable for adding new fixes. I assume that all those bugs are fixed in C# Clipper newest version and I have an intention to make use of the same code as in C# Clipper.
Angus has also not been capable of making updates, and I have a bit waited the release of floating point version of Clipper. It is huge speed improvement. You can test my beta-version:
http://jsclipper.sourceforge.net/6.1.3.4b_fpoint/main_demo3.html
http://jsclipper.sourceforge.net/6.1.3.4b_fpoint/clipper_unminified_6.1.3.4b_fpoint.js
You can of course make fixes and use the fixed version and release it somewhere if you need.
The time of making 1503 operations:
FPoint: 1836 ms
IntPoint: 5688
FPoint:
http://jsclipper.sourceforge.net/6.1.3.4b_fpoint/main_demo3.html
IntPoint:
http://jsclipper.sourceforge.net/6.1.3.2/main_demo.html
If using big integer range, the speed gain is much more bigger.
These are awesome numbers. Are there any known issues in FPoint library? I understand it is beta, just curious how stable it is?
I have not found any issues when testing with about 100 000 operations/polygon combinations. There are some differences between IntPoint and FPoint versions in common line joining (attached image). I'm not sure about which version produces "correct" result. This is one thing why I'm in hold regarding updates. I have a feeling that both versions doesn't make correct result when polygons with common lines are rotated (like in the JS Clipper Main Demo, attached image).
I made an update, where those open path bugs are fixed or should be at least:
https://sourceforge.net/projects/jsclipper/
Thank you very much!!! I will be testing this today!!
Tested and it works great! Thank you!!
Fine! I'm waiting Angus Johnson to make updates. He wrote at the Sourceforge page of original Clipper:
The thing that I'm waiting is the Floating point version, because it is so much faster at least in Javascript.