I am using the CGAL library of the C++ language to calculate the volume of the alpha shape. I have completed it, but why is its volume the same as the volume calculated by the convex hull.
this convex hull's code
Polyhedron p;
CGAL::convex_hull_3(points.begin(), points.end(), p);
double volume = CGAL::Polygon_mesh_processing::volume(p);
this alpha shape's code
double vol1 = 0.0;
std::list<Cell_handle> cells1;
as.get_alpha_shape_cells(std::back_inserter(cells1),
Fixed_alpha_shape_3::EXTERIOR);
std::list<Cell_handle>::iterator it_cell1;
for(it_cell1 = cells1.begin(); it_cell1 != cells1.end(); it_cell1++) {
Cell_handle cell = *it_cell1;
Tetrahedron t(
cell->vertex(0)->point(),
cell->vertex(1)->point(),
cell->vertex(2)->point(),
cell->vertex(3)->point()
);
vol1 += fabs(t.volume());
}
If the program is correct, the volume of the alpha shape will be smaller than that of the convex hull