# Generate random not overlapping triangles

**URL:** https://discourse.processing.org/t/generate-random-not-overlapping-triangles/25875
**Category:** Coding Questions
**Created:** [December 1, 2020, 9:19pm UTC](https://discourse.processing.org/t/generate-random-not-overlapping-triangles/25875 "2020-12-01T21:19:08Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![solub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/solub/32/333_2.png) [@solub](https://discourse.processing.org/u/solub)
#### Post date: [December 26, 2020, 7:24pm UTC](https://discourse.processing.org/t/generate-random-not-overlapping-triangles/25875/10 "2020-12-26T19:24:09Z")

</div>

> [@nktlst](#):
>
> is it right that i have to start from voronoi center point, and then build my triangle with same center point?

Not exactly. You just need to sample 3 equidistant points along the edges of the Voronoi cells and draw triangles with it. You can use the `dividePLine` function I used in this other [sketch](https://discourse.processing.org/t/triangulation-libraries-issue-unwanted-edge/25964/20).

For example:

`tri = dividePLine(vertices, 3, true);`

where:

- `vertices` is a list of the vertices of a single Voronoi cell
- `3`, the desired number of equidistant points
- `false`/`true`, a boolean indicating whether the polyline (edges of the Voronoi cell) is closed or not

---

_[View the full topic](https://discourse.processing.org/t/generate-random-not-overlapping-triangles/25875)._
