
Using Voronoi triangulation

I am hoping someone can help me get started on creating a Voronoi tessellation of a set of discrete points. I would like to accomplish the following:
1. Create an initial set of x-y (and possibly z if necessary) points that lie within a given rectangle of width W and length L.
2. Create the corresponding Voronoi tessellation.
3. Find the centroid of each Voronoi polygon. For this I would need something like lists of the vertices of each polygon.
4. Move each vertex corresponding to each polygon to the centroid point.
5. Loop to step 2 and repeat until stable.
This scheme is called Lloyd's algorithm and one use (the one I want) is to find the arrangement of points within a rectangle that are as evenly distributed as possible, in a certain sense. There is a nice visualization of this technique here. Note how the edges of the enclosing rectangle are included in the edge polygons.
So mostly I'd like some advice on performing steps 2 (mainly) and step 3 (at least as far as getting the polygon vertices). I have read the documentation but it's a bit hard to understand how to get going.
Maybe some of the reason I am stuck is because I don't understand how the /SV flag is used. If I run the command
ImageInterpolate/SV voronoi, sampleTriplet
I get the error, "Insufficient input". But I'm not sure what other input I'm supposed to give.
March 30, 2025 at 04:59 pm - Permalink
My reading of manual is that you need the /S flag for voronoi to work. /SV is instruction to save additional output, but voronoi must work first.
March 30, 2025 at 05:45 pm - Permalink
Please email contact information to support@wavemetrics.com and I'll try to help you with the problem.
AG
(I wrote the triangulation code 30 years ago)
March 31, 2025 at 03:01 pm - Permalink