# How to simulate overlapping/blocking of objects

**URL:** <https://discourse.processing.org/t/how-to-simulate-overlapping-blocking-of-objects/31204>\
**Category:** Processing.py\
**Created:** [July 12, 2021, 9:49am UTC](https://discourse.processing.org/t/how-to-simulate-overlapping-blocking-of-objects/31204 "2021-07-12T09:49:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![slashwreck](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@slashwreck](https://discourse.processing.org/u/slashwreck)\
**Post date:** [July 12, 2021, 9:49am UTC](https://discourse.processing.org/t/how-to-simulate-overlapping-blocking-of-objects/31204/1 "2021-07-12T09:49:10Z")

</div>

![2021-07-12_17-38-16](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/98e5ef7b2cee73cc44d3939f36e0400391c4871a.jpeg)

Have a simple script that draws some overlapping noisy polygons. When you fill the polygons, the resulting shape looks like a rough cylinder, because the ‘behind’ parts of the polygons are obscured. But when I send this as svg to my AxiDraw plotter, each of the polygons are drawn in full, so I lose the ‘cylinder’ effect.

Wondering what ways I can clip out the parts that i want to be obscured? Would like to do it entirely inside processing-python rather than post-processing in inkscape before I launch it to my axiDraw.

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/soegaard/32/13657_2.png) [@soegaard](https://discourse.processing.org/u/soegaard)\
**Post date:** [July 12, 2021, 12:31pm UTC](https://discourse.processing.org/t/how-to-simulate-overlapping-blocking-of-objects/31204/3 "2021-07-12T12:31:30Z")

</div>

You need to define your line drawing function and your own clipping functions.  
There are no builtin functions that match your scenario.

Alternatively, you can use a library such as

> **[rikrd/geomerative](https://github.com/rikrd/geomerative)**
>
> Geomerative is a library for Processing. It extends 2D geometry operations to facilitate generative geometry. Includes a TrueType font and an SVG interpreters. This library exposes the shapes (such...

---

<div class="post-metadata">

**Author:** ![slashwreck](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@slashwreck](https://discourse.processing.org/u/slashwreck)\
**Post date:** [July 14, 2021, 12:47pm UTC](https://discourse.processing.org/t/how-to-simulate-overlapping-blocking-of-objects/31204/4 "2021-07-14T12:47:38Z")

</div>

thank you, I’ll check out that library you cited.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [July 14, 2021, 3:01pm UTC](https://discourse.processing.org/t/how-to-simulate-overlapping-blocking-of-objects/31204/5 "2021-07-14T15:01:50Z")

</div>

> [@slashwreck](#):
>
> AxiDraw plotter

I assume that the plotter plots lines and not points?

---

<div class="post-metadata">

**Author:** ![slashwreck](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@slashwreck](https://discourse.processing.org/u/slashwreck)\
**Post date:** [July 15, 2021, 12:14am UTC](https://discourse.processing.org/t/how-to-simulate-overlapping-blocking-of-objects/31204/6 "2021-07-15T00:14:48Z")

</div>

yeah, it draws lines. It can stiple, but that’s not very good.

---

<div class="post-metadata">

**Author:** ![villares](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/villares/32/3166_2.png) [@villares](https://discourse.processing.org/u/villares)\
**Post date:** [July 18, 2021, 7:51pm UTC](https://discourse.processing.org/t/how-to-simulate-overlapping-blocking-of-objects/31204/7 "2021-07-18T19:51:45Z")

</div>

Maybe these examples of Geomerative used in Python mode can be of some help:

> **[villares/py.processing-play](https://github.com/villares/py.processing-play/tree/master/geomerative_examples)**
>
> master/geomerative\_examples
