From e7198a0d65e2ec16d1ba2d568f508cbd52db5b2e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 22 Aug 2023 15:08:42 +0100 Subject: [PATCH] Add test case that triggers an assertion --- Nef_2/test/Nef_2/issue7662.cpp | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Nef_2/test/Nef_2/issue7662.cpp diff --git a/Nef_2/test/Nef_2/issue7662.cpp b/Nef_2/test/Nef_2/issue7662.cpp new file mode 100644 index 00000000000..9ae6ff6bd91 --- /dev/null +++ b/Nef_2/test/Nef_2/issue7662.cpp @@ -0,0 +1,43 @@ +#include +#include +#include +#include +#include +#include + +typedef CGAL::Lazy_exact_nt FT; +typedef CGAL::Simple_cartesian Kernel; +typedef CGAL::Bounded_kernel Bounded_kernel; +typedef CGAL::Nef_polyhedron_2 Nef_polyhedron; +typedef Nef_polyhedron::Point Point; + + +int main(int argc, char *argv[]) +{ + Point p1[] = { + Point(0,0), + Point(100,100), + Point(0,100) + }; + + Point p2[] = { + Point(100, 100), + Point(110, 100), + Point(100, 110) + }; + + + std::list > polygons1; + polygons1.push_back(std::make_pair(p1, p1 + sizeof(p1) / sizeof(Point))); + + Nef_polyhedron poly1(polygons1.begin(), polygons1.end(), Nef_polyhedron::POLYGONS); + poly1.explorer().check_integrity_and_topological_planarity(); + + Nef_polyhedron poly2(p2, p2 + sizeof(p2) / sizeof(Point)); + poly2.explorer().check_integrity_and_topological_planarity(); + + Nef_polyhedron intersect = poly1.intersection(poly2); + intersect.explorer().check_integrity_and_topological_planarity(); + + return 0; +}