From 294715ff5313b641ba1844d64331e1d5b5306e54 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 30 Nov 2021 16:16:23 +0000 Subject: [PATCH 1/4] Fix broken greater-than --- Nef_3/include/CGAL/Nef_polyhedron_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nef_3/include/CGAL/Nef_polyhedron_3.h b/Nef_3/include/CGAL/Nef_polyhedron_3.h index 3eb723d37b70..2e602c7a50cc 100644 --- a/Nef_3/include/CGAL/Nef_polyhedron_3.h +++ b/Nef_3/include/CGAL/Nef_polyhedron_3.h @@ -1549,7 +1549,7 @@ class Nef_polyhedron_3 : public CGAL::Handle_for< Nef_polyhedron_3_rep(const Nef_polyhedron_3& N1) const - { return difference(*this).is_empty() && !difference(N1).is_empty(); } + { return N1.difference(*this).is_empty() && !difference(N1).is_empty(); } bool operator<=(const Nef_polyhedron_3& N1) const { return difference(N1).is_empty(); } From 99a8b0c15d99aaaa239095b3edba76ee67d2216d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 30 Nov 2021 16:36:31 +0000 Subject: [PATCH 2/4] Add test --- Nef_3/test/Nef_3/test_nef_3_operator.cpp | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Nef_3/test/Nef_3/test_nef_3_operator.cpp diff --git a/Nef_3/test/Nef_3/test_nef_3_operator.cpp b/Nef_3/test/Nef_3/test_nef_3_operator.cpp new file mode 100644 index 000000000000..297ca88de384 --- /dev/null +++ b/Nef_3/test/Nef_3/test_nef_3_operator.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include + + +#include +typedef CGAL::Exact_predicates_exact_constructions_kernel K; +typedef K::Point_3 Point_3; +typedef CGAL::Surface_mesh Polygon_mesh; + +typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; + +int main(int argc, char* argv[]) +{ + Point_3 p0(1,1,1), p1(2,1,1), p2(2,2,1), p3(1,2,1), p4(1,2,2), p5(1,1,2), p6(2,1,2), p7(2,2,2); + Point_3 q0(0,0,0), q1(3,0,0), q2(3,3,0), q3(0,3,0), q4(0,3,3), q5(0,0,3), q6(3,0,3), q7(3,3,3); + + Polygon_mesh A1, A2, A3, A4, A5, A6; + + make_hexahedron(p0, p1, p2, p3, p4, p5, p6, p7, A1); + make_hexahedron(q0, q1, q2, q3, q4, q5, q6, q7, A2); + Nef_polyhedron a1(A1), a2(A2); + + assert(a1 < a2); + assert(a2 > a1); + + return 0; +} From a1a289461bcb16fc5967039298a2e0f41ff18cff Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 3 Dec 2021 09:58:13 +0000 Subject: [PATCH 3/4] Remove unused variables --- Nef_3/test/Nef_3/test_nef_3_operator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nef_3/test/Nef_3/test_nef_3_operator.cpp b/Nef_3/test/Nef_3/test_nef_3_operator.cpp index 297ca88de384..fa60a5ecef57 100644 --- a/Nef_3/test/Nef_3/test_nef_3_operator.cpp +++ b/Nef_3/test/Nef_3/test_nef_3_operator.cpp @@ -11,12 +11,12 @@ typedef CGAL::Surface_mesh Polygon_mesh; typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; -int main(int argc, char* argv[]) +int main(int /* argc */, char* /* argv[] */) { Point_3 p0(1,1,1), p1(2,1,1), p2(2,2,1), p3(1,2,1), p4(1,2,2), p5(1,1,2), p6(2,1,2), p7(2,2,2); Point_3 q0(0,0,0), q1(3,0,0), q2(3,3,0), q3(0,3,0), q4(0,3,3), q5(0,0,3), q6(3,0,3), q7(3,3,3); - Polygon_mesh A1, A2, A3, A4, A5, A6; + Polygon_mesh A1, A2; make_hexahedron(p0, p1, p2, p3, p4, p5, p6, p7, A1); make_hexahedron(q0, q1, q2, q3, q4, q5, q6, q7, A2); From e1e0b737b409cf79e403170e1c7827ad930c2e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 3 Dec 2021 11:54:46 +0100 Subject: [PATCH 4/4] fix type --- Nef_3/test/Nef_3/test_nef_3_operator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nef_3/test/Nef_3/test_nef_3_operator.cpp b/Nef_3/test/Nef_3/test_nef_3_operator.cpp index fa60a5ecef57..0d8de7f21d9c 100644 --- a/Nef_3/test/Nef_3/test_nef_3_operator.cpp +++ b/Nef_3/test/Nef_3/test_nef_3_operator.cpp @@ -11,7 +11,7 @@ typedef CGAL::Surface_mesh Polygon_mesh; typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; -int main(int /* argc */, char* /* argv[] */) +int main(int /* argc */, char** /* argv[] */) { Point_3 p0(1,1,1), p1(2,1,1), p2(2,2,1), p3(1,2,1), p4(1,2,2), p5(1,1,2), p6(2,1,2), p7(2,2,2); Point_3 q0(0,0,0), q1(3,0,0), q2(3,3,0), q3(0,3,0), q4(0,3,3), q5(0,0,3), q6(3,0,3), q7(3,3,3);