diff options
author | Marius Kintel <marius@kintel.net> | 2013-01-08 18:26:25 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-01-08 18:26:25 (GMT) |
commit | 810f1a86189555023240507848ff9eebb161b8de (patch) | |
tree | 287007ba314d94a551d2ef721dfc796598fede6c /src/CGAL_Nef_polyhedron.h | |
parent | 8cea6834f68cbbfb85c2568d388bf3b2e707cca5 (diff) |
Don't just ignore geometric nodes having zero volume/area - when doing difference/intersection, they tend to turn negative objects into positive ones. Fixes #221
Diffstat (limited to 'src/CGAL_Nef_polyhedron.h')
-rw-r--r-- | src/CGAL_Nef_polyhedron.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/CGAL_Nef_polyhedron.h b/src/CGAL_Nef_polyhedron.h index e8c505b..d949a2a 100644 --- a/src/CGAL_Nef_polyhedron.h +++ b/src/CGAL_Nef_polyhedron.h @@ -8,12 +8,15 @@ class CGAL_Nef_polyhedron { public: - CGAL_Nef_polyhedron() : dim(0) {} + CGAL_Nef_polyhedron(int dim = 0) : dim(dim) {} CGAL_Nef_polyhedron(CGAL_Nef_polyhedron2 *p); CGAL_Nef_polyhedron(CGAL_Nef_polyhedron3 *p); ~CGAL_Nef_polyhedron() {} - bool empty() const { return (dim == 0 || (!p2 && !p3)); } + // Empty means it is a geometric node which has zero area/volume + bool isEmpty() const { return (dim > 0 && !p2 && !p3); } + // Null means the node doesn't contain any geometry (for whatever reason) + bool isNull() const { return !p2 && !p3; } void reset() { dim=0; p2.reset(); p3.reset(); } CGAL_Nef_polyhedron &operator+=(const CGAL_Nef_polyhedron &other); CGAL_Nef_polyhedron &operator*=(const CGAL_Nef_polyhedron &other); |