summaryrefslogtreecommitdiff
path: root/src/CGAL_Nef_polyhedron.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-11-05 17:07:56 (GMT)
committerMarius Kintel <marius@kintel.net>2011-11-05 17:07:56 (GMT)
commit4120846d18c1a7ce5a51169feb1babb0603bddc0 (patch)
tree59156a17a848c49b2d2e425b5196a57f0d707e8e /src/CGAL_Nef_polyhedron.cc
parent73c715ad9c7e9a9f2d5888caa967239064bba262 (diff)
Catch a CGAL assert caused by a subtraction resulting in non-manifold geometry. see testdata/scad/bugs/rotate-diff-nonmanifold-crash.scad
Diffstat (limited to 'src/CGAL_Nef_polyhedron.cc')
-rw-r--r--src/CGAL_Nef_polyhedron.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/CGAL_Nef_polyhedron.cc b/src/CGAL_Nef_polyhedron.cc
index 975c9a4..ccfde24 100644
--- a/src/CGAL_Nef_polyhedron.cc
+++ b/src/CGAL_Nef_polyhedron.cc
@@ -25,8 +25,16 @@ CGAL_Nef_polyhedron& CGAL_Nef_polyhedron::operator*=(const CGAL_Nef_polyhedron &
CGAL_Nef_polyhedron& CGAL_Nef_polyhedron::operator-=(const CGAL_Nef_polyhedron &other)
{
- if (this->dim == 2) (*this->p2) -= (*other.p2);
- else if (this->dim == 3) (*this->p3) -= (*other.p3);
+ // Triggered by testdata/scad/bugs/rotate-diff-nonmanifold-crash.scad
+ CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION);
+ try {
+ if (this->dim == 2) (*this->p2) -= (*other.p2);
+ else if (this->dim == 3) (*this->p3) -= (*other.p3);
+ }
+ catch (CGAL::Assertion_exception e) {
+ PRINTF("CGAL error in CGAL_Nef_polyhedron::operator-=(): %s", e.what());
+ }
+ CGAL::set_error_behaviour(old_behaviour);
return *this;
}
contact: Jan Huwald // Impressum