# HexGrid with Processing's polygon function

**URL:** <https://discourse.processing.org/t/hexgrid-with-processings-polygon-function/39174>\
**Category:** Gallery\
**Created:** [October 9, 2022, 6:41am UTC](https://discourse.processing.org/t/hexgrid-with-processings-polygon-function/39174 "2022-10-09T06:41:03Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![debxyz](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@debxyz](https://discourse.processing.org/u/debxyz)\
**Post date:** [October 9, 2022, 6:47pm UTC](https://discourse.processing.org/t/hexgrid-with-processings-polygon-function/39174/4 "2022-10-09T18:47:08Z")

</div>

@svan Grid patterns are a current focus of mine. So this is very interesting!!  
And @Chrisir’s suggestion reminded me of a post by @hamoid a while back that shows another possible(?) solution to this problem using modulo.

Scroll down to **Example 9B** :

> [@Making patterns with modulo](https://discourse.processing.org/t/making-patterns-with-modulo/17522):
>
> Hi. A friend asked me how to create 2D patterns and also how to make not only rectangular patterns but other shapes, so I thought I could answer here which might help someone else too slight_smile I’m going to assume you understand the following program: 1A - Randomness size(900, 50); background(255); noStroke(); for(int x=0; x\<30; x++) { fill(random(255)); ellipse(x\*30 + 15, 25, 28, 28); } 2A - First pattern So how can I avoid randomness and make a pattern? I’ll start by al…

🤓

---

_[View the full topic](https://discourse.processing.org/t/hexgrid-with-processings-polygon-function/39174)._
