Skip to content

Commit

Permalink
Merge pull request #6154 from afabri/Nef_3-fix_comparison-GF
Browse files Browse the repository at this point in the history
Nef_3: Fix broken greater-than
  • Loading branch information
lrineau committed Dec 3, 2021
2 parents 3beb64c + e1e0b73 commit a43eddd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Nef_3/include/CGAL/Nef_polyhedron_3.h
Expand Up @@ -1549,7 +1549,7 @@ class Nef_polyhedron_3 : public CGAL::Handle_for< Nef_polyhedron_3_rep<Kernel_,
{ return !N1.difference(*this).is_empty() && difference(N1).is_empty(); }

bool operator>(const Nef_polyhedron_3<Kernel,Items, Mark>& 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<Kernel,Items, Mark>& N1) const
{ return difference(N1).is_empty(); }
Expand Down
29 changes: 29 additions & 0 deletions Nef_3/test/Nef_3/test_nef_3_operator.cpp
@@ -0,0 +1,29 @@
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/boost/graph/generators.h>


#include <iostream>
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef K::Point_3 Point_3;
typedef CGAL::Surface_mesh<K::Point_3> Polygon_mesh;

typedef CGAL::Nef_polyhedron_3<K> 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;
}

0 comments on commit a43eddd

Please sign in to comment.