Voronoi polygon boundary

Running into an issue with voronoi generator gang.

Boundary geometry is always different depending on the input, and it’s always an irregular polygon, never a regular rectangle or square. Any ideas why the pattern is not adhering to the boundary shape?


Hello,
Can you upload the gh file?

vor-boundary-issue.gh (7.3 KB)

Sure thing, there’s not much too it haha

Like this?


vor-boundary-issue_Re.gh (13.7 KB)

1 Like

Thanks clever person!! This is exactly what I was trying to do.

1 Like

So sorry, I’ve got one more question if you don’t mind.
How would I go about creating closed polygons from the resulting pattern?

I’ve managed to create the images below, which cuts the corners of the original polygon. Is there a way to use the original boundary to inform the closed shapes I can then calculate the original areas of? I know how to do that last bit.

I figured out a really long way around it by hatching the area, dehatching into a brep and then splitting the brep with the extruded lines of the interior voronoi pattern, and then extracted the brep edges, join and close.

1 Like

It seems to have been resolved, but I have also attached an algorithm that works.

vor-boundary-issue_Re2.gh (8.8 KB)

For higher resolution voronoi grids, try to make a list branched tree with only those curves that are near the boundary curve, and perform that region operation only on those. Merge the trees together afterwards. Can significantly speed up your code. As comparison, just ran a test of 50.000 points. Without branched tree, executing time is 10* that of without

1 Like