I am very new to Grasshopper, and I was attempting to change the size of cells in a voronoi diagram based on their distances from a point that I placed in Rhino. I went through and checked the components and it looked like each cell’s distance from the point was sorted and remapped to a new domain which I then used for the voronoi cell radii. It appears to me that numbers should be being transferred properly, but I definitely don’t know enough to really troubleshoot this. Any suggestions would be greatly appreciated!
When attaching definitions always internalize referenced data or no one can use the file. (right click a component which has geometry referenced from rhino and click internalize).
Also, any reason you are using .ghx file? - the standard in .gh.
Looking at your file you are trying to change the radius of voronoi cell. Radius input there is radius for all cells - it kind of makes them all rounder unless they hit another. Notice when you hover over the radius input it doesn’t say “as list” but if you hover over P it says “Points as list”. that is your clue there. Radius for voronoi cell is one value for the entire voronoi diagram, it does not accept lists. So each value you put as radius is going to make another instance of the entire voronoi diagram result. In your case, you have 50 radius values plugged in - you are going to get 50 entire voronoi diagrams. If you want to change the size of the cells you should use the attractor values to scale the cells.
Something like this:
If the cells still have to touch all their neighbours, you can try and create a 3D voronoi solution and raise the cells you want to be small in Z. If you then intersect this 3D volume with the world XY plane, those cross sections should be smaller. However note that they can disappear entirely if you’re not careful.
Thank you so much! I completely forgot about that, and will make sure to do so next time. I was not sure much about the difference between the two, and for whatever reason, I thought that .ghx files would be better. On a related note, my computer gives me an error when I try to open your .gh file. It says, “[t]his file does not have a program associated with it for performing this action. Please install a program, or if one is already installed, create an association create an association in the Default Programs control panel.” Thank you for your help!!
I think that means your computer just doesnt know what .gh is yet and is telling you it doesn’t know what to do with it. It should be fine to open in GH.
That is very bizarre. I saved a file as a .gh and tried to open yours, and it still will not open the file
Are you opening the file from within Grasshopper? Sounds like you are trying to open it from explorer… - and that won’t work…
Open from grasshopper. File > open. Or open grasshopper and drag the file into grasshopper. You cannot open grasshopper files by double clicking them.
Much better!! Thank you all so much!!
Thanks Michael, I will definitely use .gh now.
I came up with another question. If I wanted to distort a voronoi diagram that is bounded by a rectangle (making cells larger or smaller based on distance to the point), instead of just scaling the cells down the further away from the point they get, do you have any suggestions for how I might go about this? I just want to make sure that the cells are all tesselating.
This is what I have right now.
PrecedentStudy1.ghx (293.3 KB)
@DavidRutten gave you a good description to try for something like that.
So I should extrude these cells in the z direction so that the ones I want to be smaller are extruded more. I am confused about how intersecting that volume with the XY plane would result in cross sections that touch each other. The way I am envisioning it at least, the cross sections would still be the same size as the footprint of the cells.
No extrusion. Use voronoi 3d.
Would I scrap what I have and make a Voronoi 3D from scratch? I’m sorry for all of the questions - I am having trouble conceptualizing why this would work
Something like this…(ignore the red - it’s just because some intersections miss, which is expected)
Voro3dIntersect.gh (10.1 KB)
Thanks so much Michael. I was messing around with your definition, trying to understand how it works, and was wondering why it only worked when the bounding rectangle for the Populate2D was 20 x 10. I also wondering why the definition makes a 2D voronoi diagram when you use a 3D voronoi component. Does it take a cross section of the 3D one and only show that particular cross section? Thanks so much!
why it only worked when the bounding rectangle for the Populate2D was 20 x 10
It works for any rectangle…
Does it take a cross section of the 3D one and only show that particular cross section
Hover over the end component (the one in red) and read its description.
I tried to relocate the rectangle to forming from another point, and it stopped displaying it. I figured that it was likely due to the values the domain was remapped to. Can you explain what the remapped domain component was doing? I really appreciate it. I think that was the same problem with when I manually drew a rectangle, instead of using the rectangle component. That was why I didn’t think it would work for other rectangles