Hi everyone,
I’m using Rhino 8 and trying to learn Grasshopper, so I’m still quite a beginner.
My starting idea is to represent a sample of rock composed of crystals. Since I was already somewhat familiar with Voronoi, it seemed like a reasonable way to represent this structure (although if there are better methods for this kind of problem, please let me know).
What I would like to achieve is a cube filled with 3D Voronoi cells, where I can somehow ‘control’ the distribution of the cell sizes. I’ve read about this, but the typical point attractor approach used to vary point density doesn’t seem to do exactly what I need ( Weighted Voronoi ("Solved"?!) - Grasshopper , differentiated voronoi - Grasshopper , Voronoi customization with attraction points - Grasshopper , Variable Voronoi mesh size , Sphere Packing - Radius change Dynamically - #3 by DanielPiker )
My idea was instead to divide the cube domain into many subdomains, and then assign a certain number of points to each subdomain. This way some regions would be denser than others, and in principle I could have some control over the overall distribution of the Voronoi cells.
More specifically, I want to assign a minimum of 1 and a maximum of 5 points per subdomain. I control this through percentages (for example, a certain percentage of subdomains get 1 point, another percentage get 2 points, etc.), and then I manually check that the totals match the expected counts.
However, I’m running into something I don’t understand. Once I generate n subdomains and create a list of n values indicating how many points should be generated in each cube, the points inside each subdomain are not random, they are always distributed in exactly the same way every time.
I was expecting a random distribution of points inside each subdomain, but that doesn’t seem to be happening.
Does anyone know why the point distribution remains identical, and what I might be doing wrong?Also, if anyone can think of a better approach than Voronoi for representing a crystalline rock structure like this, I’d be very interested to hear about it.
Finally, if anyone has already worked on a similar problem or encountered something like this before and found a good solution, I’d be very interested to hear how you approached it.
Thanks in advance guys!
(I’ve attached screenshots and the .gh file showing the setup)
test.gh (28.7 KB)


