tooolbox / node-potrace

JavaScript port of Potrace, for NodeJS
GNU General Public License v2.0
388 stars 34 forks source link

Path Direction Issue #14

Open ekaratzaferis opened 3 years ago

ekaratzaferis commented 3 years ago

Hey,

We have been using the "web" version of this library in our application, and now we're trying to achieve the same functionality by using this package, but the generated path is different.

Here's an example where we feed a simple ring shape to both versions:

Screenshot 2020-10-30 at 13 09 20 This package generates a path that consists of two circles, both with a counter-clockwise direction.

Screenshot 2020-10-30 at 13 09 30 On the other hand, the web version produces these circles, but one of them has a clockwise direction.

Based on some research, the difference in the direction of the paths is what creates the "cutout" shapes that we want, and that's what the "web" version produces.

Any ideas on how to fix this?

The configuration we're using is: turnPolicy: 'minority', turdSize: 3, optCurve: true, alphaMax: 1, optTolerance: 2