Given a
This implementation is motivated by the paper Algebraic Degrees of 3-Dimensional Polytopes.
using Pkg
Pkg.add(url="https://github.com/marabelotti/KoebeRealizations.jl.git")
There are two ways of giving the polytope.
The first one is as the vertex-facet incidence matrix
using KoebeRealizations
cube = Bool[
1 1 1 1 0 0 0 0
1 1 0 0 1 1 0 0
0 1 1 0 0 1 1 0
0 0 1 1 0 0 1 1
1 0 0 1 1 0 0 1
0 0 0 0 1 1 1 1
]
koebe_realization(cube)
And this returns the matrix whose rows are the vertices of the realization.
8×3 Matrix{Float64}:
0.316228 -0.707107 0.948683
-0.948684 -0.707106 0.316228
-0.316228 -0.707107 -0.948683
0.948683 -0.707107 -0.316228
0.316228 0.707107 0.948683
-0.948683 0.707107 0.316228
-0.316228 0.707107 -0.948683
0.948683 0.707107 -0.316228
The input can also be a polytope from Polymake.jl
. In this case the function also returns a polymake polytope.
using KoebeRealizations, Polymake
john73 = Polymake.polytope.johnson_solid(73)
K = koebe_realization(john73)
visual(K, FacetColor="0.54 0.17 0.89", VertexColor= "0.54 0.17 0.89", FacetTransparency=0.5)
We can naturally associate to the realization a circle packing on the sphere by considering, for every vertex, the circle passing through the tangency points of the edges containing that vertex.
This can be visualized, together with its dual, as follows:
using KoebeRealizations
john73 = Polymake.polytope.johnson_solid(73)
plot_circle_packing(john73)
Mara Belotti and Sascha Timme