# Options for making custom shapes with different contours

**URL:** <https://discourse.processing.org/t/options-for-making-custom-shapes-with-different-contours/9689>\
**Category:** Processing\
**Created:** [March 27, 2019, 5:44pm UTC](https://discourse.processing.org/t/options-for-making-custom-shapes-with-different-contours/9689 "2019-03-27T17:44:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leo\_Aguiar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/leo_aguiar/32/18942_2.png) [@Leo\_Aguiar](https://discourse.processing.org/u/Leo_Aguiar)\
**Post date:** [March 27, 2019, 5:44pm UTC](https://discourse.processing.org/t/options-for-making-custom-shapes-with-different-contours/9689/1 "2019-03-27T17:44:30Z")

</div>

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](https://docs.oracle.com/javase/tutorial/2d/advanced/complexshapes.html)

Thanks.

---

<div class="post-metadata">

**Author:** ![figraham](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/figraham/32/4161_2.png) [@figraham](https://discourse.processing.org/u/figraham)\
**Post date:** [March 27, 2019, 8:24pm UTC](https://discourse.processing.org/t/options-for-making-custom-shapes-with-different-contours/9689/2 "2019-03-27T20:24:51Z")

</div>

Look into beginContour() and endContour() in both [processing](https://processing.org/reference/beginContour_.html) and [p5](https://p5js.org/reference/#/p5/beginContour). 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](http://www.ricardmarxer.com/geomerative/). 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](https://processing.org/reference/loadShape_.html).

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 29, 2019, 12:08am UTC](https://discourse.processing.org/t/options-for-making-custom-shapes-with-different-contours/9689/3 "2019-03-29T00:08:02Z")

</div>

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

[http://www.ricardmarxer.com/geomerative/documentation/geomerative/RShape.html](http://www.ricardmarxer.com/geomerative/documentation/geomerative/RShape.html)

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