# Filling a vertex shape

**URL:** <https://discourse.processing.org/t/filling-a-vertex-shape/13099>\
**Category:** Coding Questions\
**Created:** [July 31, 2019, 3:00pm UTC](https://discourse.processing.org/t/filling-a-vertex-shape/13099 "2019-07-31T15:00:21Z")\
**Posts on this page:** 1\
**Showing post:** 11

<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:** [August 1, 2019, 8:43pm UTC](https://discourse.processing.org/t/filling-a-vertex-shape/13099/11 "2019-08-01T20:43:46Z")

</div>

Here hamoid does a similar thing with random vertexes.

He‘s sorting it prior to make a shape. Bam!

> [@How to create a random convex polygon?](https://discourse.processing.org/t/how-to-create-a-random-convex-polygon/76/10):
>
> The example above was creating an array of 64 shapes. If you only need one, you don’t need that array, and you don’t need the for loop to iterate 64 times creating and drawing all shapes. You just need one I assume. You can keep the polygon function, which just returns a shape with a polygon. The following example creates and draws a polygon every time you press a key: void setup() { size(600, 600, P2D); background(255); } void draw() { } void keyPressed() { noStroke(); fill(random(2…

---

_[View the full topic](https://discourse.processing.org/t/filling-a-vertex-shape/13099)._
