nodebox / live

Report issues with NodeBox Live
1 stars 0 forks source link

compound node polygonizes shapes #40

Open fjenett opened 6 years ago

fjenett commented 6 years ago

The compound node currently turns shapes into polygons before applying the compound operation. This leads to curves being broken into very many small line segments. To be able to use the shapes for other design work it would be good to keep the path geometry.

Paper.js has a good implementation: http://paperjs.org/examples/boolean-operations/

screen shot 2018-05-26 at 15 27 19
stebanos commented 5 years ago

Hello, indeed, I'm aware of the segmentation of compound paths, I have tried multiple times integrating the relevant code parts from paper.js in g.js (the graphics engine of NBL) but never really succeeded in a satisfying manner. Paper.js is very much an immediate mode drawing tool and its model unfortunately doesn't sit well with the functional approach used in g.js and NBL. In terms of porting it, it's not just about porting the compound paths code, but also all the other constructs that come with it, like Segment and Curve objects (which don't exist in NodeBox paths) and the way paper.js handles Grouped elements (also different in NBL). I'd be very happy if someone is ever be able to make it work.