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(); } 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..0d8de7f21d9c --- /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; + + 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; +}