Skip to content

Instantly share code, notes, and snippets.

@potpath
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save potpath/4cffa5e97338e4c01c59 to your computer and use it in GitHub Desktop.
Save potpath/4cffa5e97338e4c01c59 to your computer and use it in GitHub Desktop.
check positive span for 4 fingers using Qhull
#include<Qhull.h>
#include<QhullFacetList.h>
using namespace orgQhull;
bool isPositiveSpan(const Point3d &n1,const Point3d &n2,const Point3d &n3,const Point3d &n4){
Qhull qhull;
realT points[12]={n1.x,n1.y,n1.z,n2.x,n2.y,n2.z,n3.x,n3.y,n3.z,n4.x,n4.y,n4.z};
qhull.runQhull("",3,4,points,"");
vector<QhullFacet> facets=qhull.facetList().toStdVector();
for(const QhullFacet &facet : qhull.facetList().toStdVector())
if(facet.getFacetT()->offset>=0) return false;
return true;
}
@potpath
Copy link
Author

potpath commented Oct 7, 2014

-Dqh_QHpointer
-I/usr/include/libqhullcpp
-lqhullcpp
-lqhull

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment