paperjs / paper.js

The Swiss Army Knife of Vector Graphics Scripting – Scriptographer ported to JavaScript and the browser, using HTML5 Canvas. Created by @lehni & @puckey
http://paperjs.org
Other
14.46k stars 1.22k forks source link

Boolean operations on overlapping curves #1939

Open exobin opened 3 years ago

exobin commented 3 years ago

Description/Steps to reproduce

The subtract operation improperly includes portions of overlapping curves.

Screen Shot 2021-07-28 at 3 59 07 PM

Link to reproduction test-case

Here is a failing sketch This appears to break in all prior versions as well.

Possible hint for the solution: You will notice that the overlapping curve is divvied up in perfectly non-overlapping segments between the two "parent" shapes. When the radii of the circles are the same, the segments are equal in size, but when the radii of one of the circles changes, the sizing becomes inconsistent.

exobin commented 3 years ago

It looks like there has been a fair amount of discussion on this in the past, most notably issue #874. I've tried as many 2d art libraries that support boolean operations as I can find and all have this issue. It looks like @lehni isn't actively involved in this project anymore, but it would be amazing if he or anyone else with deep knowledge of this part of the code base could chime in. Happy to dig in myself with some direction from authors and submit a PR for a patch.

exobin commented 3 years ago

This has become a major problem for me, if anyone is up for trying to fix it I am happy to offer a bounty of 1 ETH for a working fork / pr.

xcelent2005 commented 2 years ago

problem_output

Hello, I've wrote on an old topic last time. Please pm me to discuss more.

lehni commented 2 years ago

I'm looking into it. Current state: image