I have grid of points and I want to be able to group the points depending on which cell of a voronoi diagram they are inside of.
The only way I’ve managed to get it to work is by projecting the point on to a surface created from the cell outline and sorting the points based on the intersection.
The problem is this method is extremely slow.
I am sure I’m missing something, is there a more efficient way of solving this?
consider that a Voronoi diagram is a partitioning of space where each cell represents the locations closest to that particular Point that generates the cell itself
so, even without using the Voronoi component (which draws the cell outlines) you can Closest Point your grid to the Points you are Voronoi-ing
here the Voronoi component is just disabled and it’s pretty fast:
I knew I was missing something! Of course! By nature of the voronoi diagram the closest point to the cell centroid means it belongs to that cell, silly me! I had just assumed that in some edge cases it might not be.
Thank you so much for your help inno, I can continue on with the project now that my computer isn’t grinding to a halt. From the screenshot it looks like your computer also calculates the solution twice as fast as mine, which means I’m so long overdue for an upgrade.