Leaf Voronoi diagram

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.

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

image

1 Like

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

1 Like

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?

1 Like

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:

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:

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:

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

[the attached definition uses Clipper2 plugin for curve booleans]
voronoi_leaf.gh (17.1 KB)

4 Likes

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.

1 Like

Hi @inno, Voronoi Groups could also be used for this kind of pattern
image

3 Likes

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

1 Like

oh wow, you are the man of discovery! :+1:
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 :slight_smile: of course I can’t do this :slight_smile:

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…

Nested_Voronoi.gh (13.7 KB)

[edit] nevermind :slight_smile: 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!

4 Likes

See this link


voronoi group.gh (13.4 KB)

5 Likes

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?

1 Like

voronois are awesome :sunglasses:

I always like seeing threads on them :coffee: :slightly_smiling_face:

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?

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?

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

2 Likes

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.

1 Like

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

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

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

1 Like

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

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

Voronoi_Clipper2_Offset.gh (14.1 KB)

2 Likes

I attached it here:
Voronoi_leaf (1).gh (21.6 KB)

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

I would do something like this:

Voronoi_leaf (1) (1)_Re.gh (23.9 KB)

1 Like

That’s very helpful, thank you!