diff --git a/Convex_decomposition_3/examples/Convex_decomposition_3/list_of_convex_parts.cpp b/Convex_decomposition_3/examples/Convex_decomposition_3/list_of_convex_parts.cpp index ecde3aa5d37..5c73dda5eee 100644 --- a/Convex_decomposition_3/examples/Convex_decomposition_3/list_of_convex_parts.cpp +++ b/Convex_decomposition_3/examples/Convex_decomposition_3/list_of_convex_parts.cpp @@ -17,12 +17,11 @@ // // Author(s) : Peter Hachenberger -#include #include #include #include #include -#include +#include #include #include @@ -31,16 +30,18 @@ typedef CGAL::Polyhedron_3 Polyhedron_3; typedef CGAL::Nef_polyhedron_3 Nef_polyhedron_3; typedef Nef_polyhedron_3::Volume_const_iterator Volume_const_iterator; -int main(int argc, char* argv[]) { +int main() { Nef_polyhedron_3 N; std::cin >> N; - CGAL::convex_decomposition_3(N); + CGAL::convex_decomposition_3(N); std::list convex_parts; - Volume_const_iterator ci; - for(ci = ++N.volumes_begin(); ci != N.volumes_end(); ++ci) { + // the first volumes is the outer volume, which is + // ignored in the decomposition + Volume_const_iterator ci = ++N.volumes_begin(); + for( ; ci != N.volumes_end(); ++ci) { if(ci->mark()) { Polyhedron_3 P; N.convert_inner_shell_to_polyhedron(ci->shells_begin(), P);