This tutorial is probably also available as a Jupyter notebook in the demo
folder in the polymake source and on github.
Different versions of this tutorial: latest release, release 4.13, release 4.12, release 4.11, release 4.10, release 4.9, release 4.8, release 4.7, release 4.6, release 4.5, release 4.4, release 4.3, release 4.2, release 4.1, release 4.0, release 3.6, nightly master
Polyhedral complexes in polymake
Polyhedral complexes are contained in the application fan
, so you hanve to switch application to access the full functionality.
> application "fan";
To define polyhedral complexes in polymake
, you need to provide an array of input points and a list of polytopes represented as an array of arrays of point indices.
> $pc1 = new PolyhedralComplex(POINTS=>[[1,0,0],[1,0,1],[1,1,0],[1,1,1]],INPUT_POLYTOPES=>[[0,1,2],[2,3],[1]]);
Since some of the input polytopes may be redundant, you should ask for the MAXIMAL_POLYTOPES
.
> print $pc1->MAXIMAL_POLYTOPES; {0 1 2} {2 3} > $pc1->VISUAL;
Triangulations
Triangulations of polytopes form an important special class of polytopal complexes. In polymake they are objects of type SimplicialComplex
(and thus belong to the application topaz
). However, it is easy to convert them as follows:
> $c=cube(3); > $triangulation=new PolyhedralComplex(VERTICES=>$c->VERTICES,MAXIMAL_POLYTOPES=>$c->TRIANGULATION->FACETS);
Voronoi Diagrams and regular subdivisions
There are separate tutorials for Voronoi diagrams and regluar subdivisions of point sets.