Update: I've decided to try to use a linear programming package in order to determine if the vertices of the two polytopes are linearly separable. (The vertices are really my data, not the polytopes.) I think this will work better, so I no longer need an answer to this question.
I'm writing some code that involves checking if certain polytopes are disjoint. These polytopes are defined by the convex hulls of their vertices, and I'm creating the convex hulls using Qhull
. In particular, I'm using the method:
from scipy.spatial import ConvexHull
This works fine, except that sometimes my sets have only 2 or 1 points in them. Qhull
doesn't like this, and it spits out this error:
QhullError: QH6214 qhull input error: not enough points(1) to construct initial simplex (need 3)
While executing: | qhull i Qt Options selected for Qhull 2015.2.r 2016/01/18: run-id 109084531 incidence Qtriangulate _pre-merge _zero-centrum
While I can deal with this by writing some subroutines that catch the situation that there are less than 3 points, it's frustrating that Qhull
doesn't deal with this case. So I'm looking for:
1) A simple way to make Qhull deal with this correctly
or
2) An alternative package to use
Thank you!