-
Hello, To get the volume of an alpha shape double vol = 0.0;
std::list<Cell_handle> cells;
// as.get_alpha_shape_cells(std::back_inserter(cells),
// Fixed_alpha_shape_3::EXTERIOR);
as.get_alpha_shape_cells(std::back_inserter(cells),
Fixed_alpha_shape_3::INTERIOR);
std::list<Cell_handle>::iterator it_cell;
for(it_cell = cells.begin(); it_cell != cells.end(); it_cell++) {
Cell_handle cell = *it_cell;
Tetrahedron t(
cell->vertex(0)->point(),
cell->vertex(1)->point(),
cell->vertex(2)->point(),
cell->vertex(3)->point()
);
vol += fabs(t.volume());
} In general it is correct. But not always: take a cube having edge length 2, and take So what is the correct way to get the volume? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
For alpha=2, all cells are classified as EXTERIOR so there is no volume. You can refer to the definition here. |
Beta Was this translation helpful? Give feedback.
-
Ok. I will return both the total volume of the exterior cells and the total volume of the interior cells for the user. Thanks. |
Beta Was this translation helpful? Give feedback.
For alpha=2, all cells are classified as EXTERIOR so there is no volume. You can refer to the definition here.