Skip to content

Commit a43eddd

Browse files
committed
Merge pull request #6154 from afabri/Nef_3-fix_comparison-GF
Nef_3: Fix broken greater-than
2 parents 3beb64c + e1e0b73 commit a43eddd

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

Nef_3/include/CGAL/Nef_polyhedron_3.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ class Nef_polyhedron_3 : public CGAL::Handle_for< Nef_polyhedron_3_rep<Kernel_,
15491549
{ return !N1.difference(*this).is_empty() && difference(N1).is_empty(); }
15501550

15511551
bool operator>(const Nef_polyhedron_3<Kernel,Items, Mark>& N1) const
1552-
{ return difference(*this).is_empty() && !difference(N1).is_empty(); }
1552+
{ return N1.difference(*this).is_empty() && !difference(N1).is_empty(); }
15531553

15541554
bool operator<=(const Nef_polyhedron_3<Kernel,Items, Mark>& N1) const
15551555
{ return difference(N1).is_empty(); }
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
2+
#include <CGAL/Surface_mesh.h>
3+
#include <CGAL/Nef_polyhedron_3.h>
4+
#include <CGAL/boost/graph/generators.h>
5+
6+
7+
#include <iostream>
8+
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
9+
typedef K::Point_3 Point_3;
10+
typedef CGAL::Surface_mesh<K::Point_3> Polygon_mesh;
11+
12+
typedef CGAL::Nef_polyhedron_3<K> Nef_polyhedron;
13+
14+
int main(int /* argc */, char** /* argv[] */)
15+
{
16+
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);
17+
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);
18+
19+
Polygon_mesh A1, A2;
20+
21+
make_hexahedron(p0, p1, p2, p3, p4, p5, p6, p7, A1);
22+
make_hexahedron(q0, q1, q2, q3, q4, q5, q6, q7, A2);
23+
Nef_polyhedron a1(A1), a2(A2);
24+
25+
assert(a1 < a2);
26+
assert(a2 > a1);
27+
28+
return 0;
29+
}

0 commit comments

Comments
 (0)