Closed mrwoodo closed 3 years ago
The library assumed that PShapes with isClosed()
as true would have to be polygonal, but seems that some lines (shapes with 2 vertices) are slipping through as 'closed', causing an error trying to create a polygon from them. I've made a code change to fix this.
With the way you've coded the approach you're generating lots of group PShapes with nested components. These can all be seen when we translate them randomly.
Another approach could be: for each layer, subtract from it the union of all its upper layers (however I haven't tested this).
Thank you @micycle1 can't wait to try it out! I tried to use the updated .jar from jitpack - It is a lot smaller (140kb) compared to the original I grabbed from /releases. I'm guessing it doesn't have all the dependencies bundled in, sorry it's all a dark art to me at the moment.
Yeah, that's correct. The Jitpack version doesn't include dependencies. As it's a maven artifact, it's designed to be used with Maven which will download all dependencies automatically.
I'll release a new version at some point -- now I'm working on some other features to be included in it.
Hi @micycle1, I'm using PGS to do hidden line removal for my old Roland plotter. The idea is that because the plotter has no concept of .fill(), I'm progressively subtracting / merging shapes from each other.
It seems to work for the most part, but I intermittently get an illegal arg exception - Invalid number of points in LinearRing (found 2 - must be 0 or >= 4) when calling PGS_ShapeBoolean.subtract()
I've tried to mock this up in the below code - it will stop at the offending PShape and draw in pink. All the 'valid' PShapes above that one will be drawn in black.
Hoping for some pointers please, maybe I'm misusing the subtract / shape group ? Apologies in advance, I'm new to both Java & Processing!