# How to create a reverse fill? Possible?

**URL:** https://discourse.processing.org/t/how-to-create-a-reverse-fill-possible/25842
**Category:** Coding Questions
**Created:** [November 30, 2020, 9:35pm UTC](https://discourse.processing.org/t/how-to-create-a-reverse-fill-possible/25842 "2020-11-30T21:35:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dgoren1](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dgoren1](https://discourse.processing.org/u/dgoren1)
#### Post date: [November 30, 2020, 9:35pm UTC](https://discourse.processing.org/t/how-to-create-a-reverse-fill-possible/25842/1 "2020-11-30T21:35:52Z")

</div>

Hello!

I am trying to figure out how to create a reverse fill of this shape that I have drawn. The purpose of the reverse fill will be to block out some other shapes that I’m drawing outside the borders of this original shape.

Here is the shape:

```auto

void setup() {
  size(1080,1080);
  background(0);
}

void draw() {
  pushMatrix();
  translate(width/2,height/2);
  beginShape();
  noFill();
  stroke(255);
  for (float a = 0; a < TWO_PI; a+=0.01) {
   float r = 400;
   float x = r * pow(cos(a),3);
   float y = r * sin(a);
   vertex(x*0.5,y);
  }
  endShape();
  popMatrix();
}

```

Attached is an illustration of the reverse fill that I created using Photoshop, but I’m wondering if I can create the black section programmatically to give me the ability to morph (grow and shrink) the black, reverse fill section along with the original shape in real-time. Let me know if this makes sense or if there are any questions!

Thanks for any help in advance!

 ![cocoon-reversefill](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/2f1f914c4b5c4470b30ec34dd376c6d97b539122.png)

---

<div class="post-metadata">

### Author: ![dgoren1](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dgoren1](https://discourse.processing.org/u/dgoren1)
#### Post date: [December 1, 2020, 8:53pm UTC](https://discourse.processing.org/t/how-to-create-a-reverse-fill-possible/25842/2 "2020-12-01T20:53:10Z")

</div>

Ended up figuring this one out. For anyone interested, the `beginContour()` and `endContour()` functions allow you to do this!

[https://processing.org/reference/PShape\_beginContour\_.html](https://processing.org/reference/PShape_beginContour_.html)
