summaryrefslogtreecommitdiff
path: root/src/CGAL_Nef_polyhedron.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-08 07:24:10 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-08 07:24:10 (GMT)
commita23edb4adc6a29e59565ce6009c980659a79423a (patch)
treec34d217f2f0942c0b47c826c1f8b492410f5793f /src/CGAL_Nef_polyhedron.cc
parenta18dd3961d96ac7f0bc38ab554170d29a99451e5 (diff)
Catch CGAL assert on certain minkowski operations
Diffstat (limited to 'src/CGAL_Nef_polyhedron.cc')
-rw-r--r--src/CGAL_Nef_polyhedron.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/CGAL_Nef_polyhedron.cc b/src/CGAL_Nef_polyhedron.cc
index 6dcbdea..ea08ca1 100644
--- a/src/CGAL_Nef_polyhedron.cc
+++ b/src/CGAL_Nef_polyhedron.cc
@@ -1,10 +1,13 @@
#include "CGAL_Nef_polyhedron.h"
#include "cgal.h"
#include "cgalutils.h"
+#include "printutils.h"
#include "polyset.h"
#include "dxfdata.h"
#include "dxftess.h"
#include <CGAL/minkowski_sum_3.h>
+#include <CGAL/assertions_behaviour.h>
+#include <CGAL/exceptions.h>
CGAL_Nef_polyhedron& CGAL_Nef_polyhedron::operator+=(const CGAL_Nef_polyhedron &other)
{
@@ -31,8 +34,15 @@ extern CGAL_Nef_polyhedron2 minkowski2(const CGAL_Nef_polyhedron2 &a, const CGAL
CGAL_Nef_polyhedron &CGAL_Nef_polyhedron::minkowski(const CGAL_Nef_polyhedron &other)
{
- if (this->dim == 2) (*this->p2) = minkowski2(*this->p2, *other.p2);
- else if (this->dim == 3) (*this->p3) = CGAL::minkowski_sum_3(*this->p3, *other.p3);
+ CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION);
+ try {
+ if (this->dim == 2) (*this->p2) = minkowski2(*this->p2, *other.p2);
+ else if (this->dim == 3) (*this->p3) = CGAL::minkowski_sum_3(*this->p3, *other.p3);
+ }
+ catch (CGAL::Assertion_exception e) {
+ PRINTF("CGAL error in minkowski %s", e.what());
+ CGAL::set_error_behaviour(old_behaviour);
+ }
return *this;
}
contact: Jan Huwald // Impressum