From 40dc4a43cfceb07c0dcb9a8a372533bf3fec1487 Mon Sep 17 00:00:00 2001 From: Susan Hert Date: Mon, 26 Nov 2001 17:16:46 +0000 Subject: [PATCH] made convexity test work for the case when the polyhedron is a single triangular face --- Packages/Convex_hull_3/changes.txt | 4 ++++ .../test/Convex_hull_3/quickhull_test_3.C | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/Packages/Convex_hull_3/changes.txt b/Packages/Convex_hull_3/changes.txt index efd4b8bb494..34114b363ad 100644 --- a/Packages/Convex_hull_3/changes.txt +++ b/Packages/Convex_hull_3/changes.txt @@ -1,3 +1,7 @@ +2.31 (26 Nov 2001) +- made convexity test work for the case when the polyhedron is a single + triangular face + 2.30 (26 Nov 2001) - fixed convexity testing so a tetrahedron now correctly passes the test diff --git a/Packages/Convex_hull_3/test/Convex_hull_3/quickhull_test_3.C b/Packages/Convex_hull_3/test/Convex_hull_3/quickhull_test_3.C index 9e64118ac85..443e3245057 100644 --- a/Packages/Convex_hull_3/test/Convex_hull_3/quickhull_test_3.C +++ b/Packages/Convex_hull_3/test/Convex_hull_3/quickhull_test_3.C @@ -51,6 +51,23 @@ void test_tetrahedron_convexity() assert( CGAL::is_strongly_convex_3(P) ); } +void test_triangle_convexity() +{ + Polyhedron_3 P; + + P.make_triangle( Point_3(1,0,0), + Point_3(-1,1,0), + Point_3(0,0,1)); + + for( Polyhedron_3::Facet_iterator f = P.facets_begin(); + f != P.facets_end(); ++f ) + { + CGAL::compute_plane_equation(f); + } + + assert( CGAL::is_strongly_convex_3(P) ); +} + void test_small_hull() { std::vector points; @@ -76,8 +93,13 @@ void test_small_hull() int main() { + std::cerr << "Testing triangle" << std::endl; + test_triangle_convexity(); + std::cerr << "Testing tetrahedron" << std::endl; test_tetrahedron_convexity(); + std::cerr << "Testing small hull" << std::endl; test_small_hull(); + std::vector points; Generator g(500); CGAL::copy_n( g, num, std::back_inserter(points));