Voronoï playground: weighted Voronoï relaxation
This block experiments the Lloyd’s relaxation algorithm on weighted sites.
This block is an adaptation of veltam‘s Voronoi relaxation block, which applies the algorithm to basic, non-weigthed, sites.
At each iteration
- the weighted voronoi diagram is computed based on each weighted sites, thanks to the d3-weighted-voronoi plugin
- then, each site is re-position at the center of its influence area
The algorithm stops when each site no longer moves (more exactly, when each site moves below a certain treshold).
User interactions :
- you can choose to draw the Weighted Voronoï Diagram (default) or the weights (visualized as circles).
- you can hide/show sites
- you can choose among different rendering (greyscale, radial rainbow, or conical rainbow (default, having hard-&-fun time to implement it because canvas don’t provides conical gradient)).
Acknowledgments to :