copied voronoi sample.