# Scaling random voronoi to uniform/regular

Hi there,

I have a collection of randomly spaced points (uk petrol stations) and I am looking create an evenly spaced version of this point collection, but maintaining the same adjacency relationships. I have attached the uk constituency map, which is a perfect example of how I was thinking to achieve this: by creating voronoi cells and then making all the cells even, but I cannot figure out this step.

Any help very much appreciated.

Thanks
Will

I donât see any âattachmentâ? Points internalized in a GH file would be nice, in addition to any image.

whoops my bad, here they are! ta.

forGHforum.gh (39.9 KB)

I donât see the correlation between a hex grid âconstituency mapâ and âan evenly spaced version of this point collectionâ? Itâs fairly simple to create a hexagonal grid and color it based on point density, though gets slow at higher resolutions.

hex_grid_2021Feb2a.gh (50.5 KB)

my thought, donât take it too seriously

you have a Voronoi diagram, I would first get the dual of those cells using something like starling pmDual component ( Starling | Food4Rhino )

then I would create a mesh out of those polylines (they are all triangles)
[I used MeshFromPolylines from Fox Fox | Food4Rhino )

forGHforum_Re.gh (44.0 KB)

at this point it might âjustâ (lol) be a matter of relaxing that mesh and make it fit some boundaries (kangaroo â circle packing? will think about that while sleeping)

the thing is: if you exceed with the point-to-point distance, they will of course spread evenly inside their boundary into hexagonal-ish cells

for instance, with the points inside the rectangular boundary you have attached, youâll always end up with an array of hexagons inside a rectangle, exactly like in @Joseph_Oster post

Assuming you want to keep the number of point (and thus hexagons) the same, is this correct? And some relationship to the underlying map?

I took a first pass using kangaroo to relax a delaunay triangulation:

Is this what you are looking for (see attached)? Itâs not totally regular, which seems problematic. Maybe you can map the points back to a hexagrid overlay? Thoughts? forGHforum_edit.gh (51.2 KB)

Cheers for the replies guys, yes that circle packing is very much along the lines of what I had in mind!

Thanks for the hexagon approach too though, although I was looking in this case for the cell number to be the same as the number of points, this is super useful to have learnt.

Grasshopper is so mind-blowing, im only a rookie but already determined to learn as much ASAP. Very appreciative of this great forum to make the otherwise impossible possible.
FYI, the next step for this project is try and create a ânationwide emergency waste strategyâ, creating distribution patterns, with some petrol stations being central hubs surrounded by amounts per % of type of construction waste we produce. This will hopefully produce a âreproductionâ esk animation that grows out of the central hubs. wish me luck. This dense version of the point cloud is for communicating these patterns clearly.

Thanks

1 Like