Search code examples
pythoncomputational-geometry

Edges of polytope in python


I have looked all over for this, but I can't find anything! I used pycddlib to get the vertices of a polytope from the inequalities representation. However, I need not only the vertices, but the edges as well. I can't find any packages to get them; convex hull libraries give facets or vertex lists but not edges.


Solution

  • Two vertices constitute an edge if both of them are on two planes.

    If library doesn't return information about plane-vertex connectivity, than for each vertex check on which planes it is by putting it in inequalities. Than find pairs of vertices that share two planes.