I have created a convex hull with some 3D points using the CGAL library. Now I want to check whether a point is inside the hull or not. But couldn't find any options to do so. Can anyone help?
My code is bellow.
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/point_generators_3.h>
#include <CGAL/algorithm.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/convex_hull_3.h>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Polyhedron_3<K> Polyhedron;
typedef K::Point_3 Point;
std::vector<Point> hullPoints[16];
int numPoints[16];
Polyhedron poly[16];
//Reading hull points
for(int i=0;i<a->vertI;i++)
{
for(int j=0;j<16;j++)
{
if(a->vertices[i][1] <= (a->maxY-(j*(a->maxY-a->minY)/16.0)) && a->vertices[i][1] >= (a->maxY-((j+1)*(a->maxY-a->minY)/16.0)) )
{
hullPoints[j].push_back(Point(a->vertices[i][0],a->vertices[i][1],a->vertices[i][2]));
}
}
}
//Create hull
for(int i=0;i<16;i++)
{
CGAL::convex_hull_3(hullPoints[i].begin(), hullPoints[i].end(), poly[i]);
std::cout << "The convex hull " << i <<" contains " << poly[i].size_of_vertices() << " vertices" << std::endl;
}
Its workng perfectly and I can access the Poly to see no of vertices present in it. But not able to find and function to check whether a point is inside of it or not.