Here is an example: three points in the plane (we use homogeneous coordinates, hence the extra "1" in front):
Code: Select all
> $V=new VoronoiDiagram(SITES=>[[1,0,0],[1,1,0],[1,0,1]]);
> print $V->FACETS;
0 0 0 1
1 -2 0 1
1 0 -2 1
1 0 0 0
The FACETS correspond to the SITES (in the same ordering). The extra facet "1 0 0 0" at infinity is always there as the polyhedron describing the Voronoi diagram, is always unbounded. No actual computation took place so far. The following triggers the convex hull computation. The Voronoi diagram has only one vertex in this case (all other VERTICES of the polyhedron are rays).
Code: Select all
> print $V->VORONOI_VERTICES;
1 1/2 1/2
To see the adjacency information among the Voronoi cells:
Code: Select all
> print rows_numbered($V->DUAL_GRAPH->ADJACENCY);
0:1 2 3
1:0 2 3
2:0 1 3
3:0 1 2
The first line (numbered 0) says that site number 0 is adjacent to site 1 and site 2. The extra "3" does not carry information as it refers to the far face. Similarly for sites numbered 1 and 2. The last line (again related to the far face) just lists those Voronoi regions which are unbounded (all regions, in this case). To see which site is which:
Code: Select all
> print rows_numbered($V->SITES);
0:1 0 0
1:1 1 0
2:1 0 1
Of course, all those commands can also be used in a polymake script (e.g., to write this info into some file).