diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index 5ea8138b55b..70038f9c9c5 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -690,8 +690,12 @@ ch_quickhull_polyhedron_3(std::list& points, non_coplanar_quickhull_3(points, tds, traits); copy_face_graph(tds,P); } - else - make_tetrahedron(v0->point(),v1->point(),v2->point(),v3->point(),P); + else{ + CGAL_assertion( traits.has_on_positive_side_3_object()( + construct_plane(v2->point(),v1->point(),v0->point()), + v3->point()) ); + make_tetrahedron(v0->point(),v1->point(),v3->point(),v2->point(),P); + } } } diff --git a/Convex_hull_3/test/Convex_hull_3/ch3_4points.cpp b/Convex_hull_3/test/Convex_hull_3/ch3_4points.cpp new file mode 100644 index 00000000000..87714c6d437 --- /dev/null +++ b/Convex_hull_3/test/Convex_hull_3/ch3_4points.cpp @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_3 Point_3; +typedef CGAL::Polyhedron_3 Gm_polyhedron; + +int main() +{ + Point_3 points[] = { Point_3(1.0, 0.0, 0.0), Point_3(0.0, 1.0, 0.0), Point_3(0.0, 0.0, 1.0), Point_3(0.0, 0.0, 0.0) }; + Gm_polyhedron P1; + CGAL::convex_hull_3(points, &points[4], P1); + CGAL_assertion( CGAL::Polygon_mesh_processing::is_outward_oriented(P1) ); + + Point_3 points_bis[] = { Point_3(0.0, 1.0, 0.0), Point_3(1.0, 0.0, 0.0), Point_3(0.0, 0.0, 1.0), Point_3(0.0, 0.0, 0.0) }; + CGAL::convex_hull_3(points_bis, &points_bis[4], P1); + CGAL_assertion( CGAL::Polygon_mesh_processing::is_outward_oriented(P1) ); +}