Voronoi with a Polygon instead of a Rectangle?

Hey all, is there a way to do a voronoi on a pop2d without it being a rectangle? Every time I do it it always shows a rectangle despite the shape i assign it to.

How do i do it for a pentagon or a randomised polygon for example?

Also is there a way to make a voronoi from a Pop2d that then ignores all of the boundary zones out of curiosity?

cheers!

Hey Kim, thank you for the suggestion, but those examples still use a rectangular boundary.

Is there a way to define a 5+ sided boundary? I want to be able to use a shape that looks like a voronoi cell basically.

Use a region intersection with your desired polygon on the rectangular voronoi output curves

You can also split the voronoi curves with your polygon, close them, take their centers, and sort which curve’s centers are inside or outside using “point in curve” and cull the ones that are outside. That works if the region intersection isn’t giving you consistent results.

Here’s a quick demo…


VoronoiBoundaryDemo_re.gh (8.7 KB)

2 Likes

That looks awesome, thank you!