# Leaf Voronoi diagram

**URL:** <https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788>\
**Category:** Grasshopper\
**Tags:** windows\
**Created:** [March 26, 2024, 10:10pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788 "2024-03-26T22:10:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loveni\_Ha](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/loveni_ha/32/485698_2.png) [@Loveni\_Ha](https://discourse.mcneel.com/u/Loveni_Ha)\
**Post date:** [March 26, 2024, 10:10pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/1 "2024-03-26T22:10:39Z")

</div>

Hello! I want to make a Voronoi diagram out of a leaf boundary that I have. I would like to make it like this diagram here with the main veins being boundaries for the Voronoi cells.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/c/c/c/ccc3da0d1fb1d332bdd14aebed8e993a6126827d.jpeg)

How can I achieve this? Given that I have no “veins” so far in the leaf, just the outer boundary:

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/7/1/d71aece286789a880091051ace7633de57f4d19b.png)

---

<div class="post-metadata">

**Author:** ![inno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/inno/32/544036_2.png) [@inno](https://discourse.mcneel.com/u/inno)\
**Post date:** [March 27, 2024, 2:28pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/3 "2024-03-27T14:28:28Z")

</div>

the author of the image used GH to do it 🙂 and the process is even described on the page where the image comes from 🙂

> **[Leaf Venation in Grasshopper](https://omarohelmy.blogspot.com/2014/09/leaf-venation-in-grasshopper.html)**
>
> Leaf Venation I have always been fascinated with organic growth in general, and specifically patterns in plants. Things like the venation ...

---

<div class="post-metadata">

**Author:** ![Loveni\_Ha](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/loveni_ha/32/485698_2.png) [@Loveni\_Ha](https://discourse.mcneel.com/u/Loveni_Ha)\
**Post date:** [March 27, 2024, 2:33pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/4 "2024-03-27T14:33:29Z")

</div>

Yes, I’ve read the page but I have a problem with making the Voronoi fit into the leaf boundary because it makes it bound by a rectangle instead. Any idea on how to make the leaf be the boundary?

---

<div class="post-metadata">

**Author:** ![inno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/inno/32/544036_2.png) [@inno](https://discourse.mcneel.com/u/inno)\
**Post date:** [March 27, 2024, 3:45pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/5 "2024-03-27T15:45:22Z")

</div>

the standard Voronoi Component computes Voronoi diagrams only with rectangular bounds, but that doesn’t mean you can’t trim out the portion of graph you are not interested into

when the autor references to nested Voronoi diagrams, he means he create a separate Voronoi diagrams for each half-leaf to create the veins first, then inside each of those cell he creates new ones

for instance, given half a leaf, you populate it with some points (which I believe are hand placed, not random) like this, and create a first Voronoi:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/8/8/188e45c37e21c6253aeeb0da6a1b9d7b26881c22.jpeg)

the output of the Voronoi Component is closed polylines, so you can easily intersect those with your original half-leaf silhouette to get the final cells, and create Boundary Surfaces out of them:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/8/8/3884af0bbff623b68d6aa7dc50e4aa4244bc9f50.png)

then you populate each of those surfaces again with points (this time I believe they are random), and the amount of points might be a function of the area of each Surface, like the following, on which you create again new voronois:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/c/0/8/c08e042b22b200c1fc23586742b62875336a2549.png)

which looks like a big mess again, until when you intersect those voronois with their respective cells:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/f/8/1f8f7c54c0fbbf758d2cc3a7a759a98fa71b0f54.jpeg)

[the attached definition uses Clipper2 plugin for curve booleans]  
[voronoi\_leaf.gh](https://discourse.mcneel.com/uploads/short-url/8fPGUypWZTDOb2qlePlQNPf7BKs.gh) (17.1 KB)

---

<div class="post-metadata">

**Author:** ![Loveni\_Ha](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/loveni_ha/32/485698_2.png) [@Loveni\_Ha](https://discourse.mcneel.com/u/Loveni_Ha)\
**Post date:** [March 27, 2024, 9:08pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/6 "2024-03-27T21:08:41Z")

</div>

That makes sense, thank you! Which function can I use instead of Clipped2Boolean to obtain the Voronoi cells because the plug-in doesn’t work for me.

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [March 27, 2024, 9:23pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/7 "2024-03-27T21:23:17Z")

</div>

Hi @inno, Voronoi Groups could also be used for this kind of pattern  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/5/6/d56b4082835446b3d42bdff504d0517ac3577af6.png)

---

<div class="post-metadata">

**Author:** ![Loveni\_Ha](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/loveni_ha/32/485698_2.png) [@Loveni\_Ha](https://discourse.mcneel.com/u/Loveni_Ha)\
**Post date:** [March 28, 2024, 3:40am UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/8 "2024-03-28T03:40:31Z")

</div>

I got it, thanks! I can use Region Intersection which is good as well.

---

<div class="post-metadata">

**Author:** ![inno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/inno/32/544036_2.png) [@inno](https://discourse.mcneel.com/u/inno)\
**Post date:** [March 28, 2024, 5:19pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/9 "2024-03-28T17:19:01Z")

</div>

oh wow, you are the man of discovery! 👍  
I didn’t ever noticed that component even existed!

but I’m having some troubles understanding how I’m supposed to define where to nest what 🙂 of course I can’t do this 🙂

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/e/c/3ec8d5729b00345a27f0ff86be3d23646c66f5f9.png)

so I thought of creating some squares over each point of “voronoi\_layer\_0” to identify some areas to populate with points that will be used in “voronoi\_layer\_1”, but there are some straight lines that I don’t fully understand where they come from…

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/8/8/d88f5cc29344aa0fb8fea9f344a99ab7b572e95c.png)

[Nested\_Voronoi.gh](https://discourse.mcneel.com/uploads/short-url/2v4Q1fqA5xykYHP7Zab0Cc1ECy5.gh) (13.7 KB)

[edit] nevermind 🙂 looks like it actually “understands” on its own which point of generation i+1 is inside which cell of generation i, so it doesn’t want branches, but just flat lists of points!

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/a/6/8/a6878f7ef0bc1c3461c81b8a834b130092aa3447.png)

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [March 28, 2024, 5:59pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/10 "2024-03-28T17:59:25Z")

</div>

See this link

> **[Voronoi group](https://www.grasshopper3d.com/forum/topics/voronoi-group)**
>
> Hi, i need to do something like the images above and i guess voronoi group is the solution, but i have no idea how to use it. Can anyone help me please?

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/c/d/0cd5233b8f7c95a6ad98bd0dd3868e135ea2225b.jpeg)  
[voronoi group.gh](https://discourse.mcneel.com/uploads/short-url/c5Uv6YPWppO7q7dIt1ZUQgiHjS3.gh) (13.4 KB)

---

<div class="post-metadata">

**Author:** ![Loveni\_Ha](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/loveni_ha/32/485698_2.png) [@Loveni\_Ha](https://discourse.mcneel.com/u/Loveni_Ha)\
**Post date:** [March 29, 2024, 6:01pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/11 "2024-03-29T18:01:06Z")

</div>

That’s a great tool, thank you for sharing! Also, do you know if it is possible to increase the thickness of the major veins so that it resembles the leaf better?

---

<div class="post-metadata">

**Author:** ![lander](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/lander/32/511244_2.png) [@lander](https://discourse.mcneel.com/u/lander)\
**Post date:** [March 29, 2024, 7:08pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/12 "2024-03-29T19:08:08Z")

</div>

voronois are awesome 🕶

I always like seeing threads on them ☕ 🙂

---

<div class="post-metadata">

**Author:** ![Loveni\_Ha](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/loveni_ha/32/485698_2.png) [@Loveni\_Ha](https://discourse.mcneel.com/u/Loveni_Ha)\
**Post date:** [April 2, 2024, 2:46am UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/13 "2024-04-02T02:46:54Z")

</div>

I’ve tried using the Scale function to increase the thickness of the veins (right side). However, it is not uniform. What parameter could I use to make the veins’ thickness be uniform?

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/c/9/1c9dd63c63477150f6843f53c6d1dc2d0f4b75d9.png)

Also, I’m having trouble with using the Voronoi Groups component for this scaled Voronoi (generation 1). Do you think it is still possible to use Voronoi Groups for this scaled version? If not, how would you change the nested Voronoi definition to include scaled Voronoi cells for generation 1 veins?

---

<div class="post-metadata">

**Author:** ![inno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/inno/32/544036_2.png) [@inno](https://discourse.mcneel.com/u/inno)\
**Post date:** [April 2, 2024, 10:07am UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/14 "2024-04-02T10:07:47Z")

</div>

scaling different sized things by the same factor is not a good approach if you are looking for uniform results, I would go for Offset

as the first generation of Cells defines the overall look of your veins, I would opt for hand-picked points for G1, then I would just populate the whole geomery with random points for G2

---

<div class="post-metadata">

**Author:** ![aramon](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/aramon/32/645528_2.png) [@aramon](https://discourse.mcneel.com/u/aramon)\
**Post date:** [April 2, 2024, 4:10pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/15 "2024-04-02T16:10:39Z")

</div>

I think lineweighting the areas by nested group might be the best way to achieve that effect. Depends on what the end goal is here, but if it’s more for visuals then that will be straightforward and look great.

---

<div class="post-metadata">

**Author:** ![Loveni\_Ha](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/loveni_ha/32/485698_2.png) [@Loveni\_Ha](https://discourse.mcneel.com/u/Loveni_Ha)\
**Post date:** [April 2, 2024, 4:20pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/16 "2024-04-02T16:20:49Z")

</div>

Thank you, Offset works better! I’ve tried with Offset using this:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/8/7/b/87b9261c7a4a5ea13eff3964be7975f54dd49a4e.png)

However, I get these not well-defined cells which I don’t know how to fix:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/0/5/b057d11525b2fbe5cf4c8ead2785b6d280323e9b.png)

---

<div class="post-metadata">

**Author:** ![Loveni\_Ha](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/loveni_ha/32/485698_2.png) [@Loveni\_Ha](https://discourse.mcneel.com/u/Loveni_Ha)\
**Post date:** [April 2, 2024, 4:22pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/17 "2024-04-02T16:22:05Z")

</div>

That’s a great idea for better visuals, thank you!

---

<div class="post-metadata">

**Author:** ![inno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/inno/32/544036_2.png) [@inno](https://discourse.mcneel.com/u/inno)\
**Post date:** [April 2, 2024, 7:17pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/18 "2024-04-02T19:17:44Z")

</div>

I don’t know exactly what is going on in your definition, you didn’t attach it 🙂

this is a general case, still using Clipper2 + standard Voronoi + Offset Curve

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/0/9/90926e6d32b7f70d933a583265b07e6c3d7fe20c.png)

[Voronoi\_Clipper2\_Offset.gh](https://discourse.mcneel.com/uploads/short-url/v8frcYf7b0eWrjwNENdE7In8tgE.gh) (14.1 KB)

---

<div class="post-metadata">

**Author:** ![Loveni\_Ha](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/loveni_ha/32/485698_2.png) [@Loveni\_Ha](https://discourse.mcneel.com/u/Loveni_Ha)\
**Post date:** [April 2, 2024, 9:55pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/20 "2024-04-02T21:55:02Z")

</div>

I attached it here:  
[Voronoi\_leaf (1).gh](https://discourse.mcneel.com/uploads/short-url/xLqes424y5689ZJf2Vnpuctwrzx.gh) (21.6 KB)

I’m using Region intersection because Clipper2 plug-in doesn’t work on my Grasshopper somehow.

---

<div class="post-metadata">

**Author:** ![inno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/inno/32/544036_2.png) [@inno](https://discourse.mcneel.com/u/inno)\
**Post date:** [April 2, 2024, 11:31pm UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/21 "2024-04-02T23:31:19Z")

</div>

I would do something like this:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/8/9/f895dd30ead1819ce5022c235f23533788f58243.png)

[Voronoi\_leaf (1) (1)\_Re.gh](https://discourse.mcneel.com/uploads/short-url/1CGSCOerPXLcLfSjRqwjoL8ZOdK.gh) (23.9 KB)

---

<div class="post-metadata">

**Author:** ![Loveni\_Ha](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/loveni_ha/32/485698_2.png) [@Loveni\_Ha](https://discourse.mcneel.com/u/Loveni_Ha)\
**Post date:** [April 3, 2024, 11:58am UTC](https://discourse.mcneel.com/t/leaf-voronoi-diagram/178788/22 "2024-04-03T11:58:11Z")

</div>

That’s very helpful, thank you!
