Options for making custom shapes with different contours

Hi community,

I’m searching for ways for making custom shapes.

I have tried using the beginContour() and endContour() functions with the beginShape()/endShape() functions but there are limitations to using them. For example, there’s no option for having different types of contour such a union, subtraction intersection or exclusion.

Is there something in Processing or P5js that can make complex shapes like the ones described in the following link: https://docs.oracle.com/javase/tutorial/2d/advanced/complexshapes.html


Look into beginContour() and endContour() in both processing and p5. I think by default it works like xor. I don’t know if you can change that. Be sure to read the documentation because the order of adding points matters. If you still need more options you could look into the geometrive library. I haven’t used it but I think it’s the most likely to have what you’re looking for. Also if the designs are static you can make them in illustrator or inkscape and then import them as a svg.

1 Like

Geomerative RShape has union / intersection / xor / diff methods.


I believe that they are of the form RShape.method(RShape) = complex RShape – and that they are polygon/polygon.