summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CGAL_Nef_polyhedron.cc26
-rw-r--r--tests/CMakeLists.txt1
2 files changed, 13 insertions, 14 deletions
diff --git a/src/CGAL_Nef_polyhedron.cc b/src/CGAL_Nef_polyhedron.cc
index 4761d26..49b9a53 100644
--- a/src/CGAL_Nef_polyhedron.cc
+++ b/src/CGAL_Nef_polyhedron.cc
@@ -96,24 +96,22 @@ PolySet *CGAL_Nef_polyhedron::convertToPolyset()
}
else if (this->dim == 3) {
CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION);
+ bool err = true;
+ std::string errmsg("");
+ CGAL_Polyhedron P;
try {
- CGAL_Polyhedron P;
- bool err = nefworkaround::convert_to_Polyhedron<CGAL_Kernel3>( *(this->p3), P );
+ err = nefworkaround::convert_to_Polyhedron<CGAL_Kernel3>( *(this->p3), P );
//this->p3->convert_to_Polyhedron(P);
- if (err) {
- PRINT("ERROR: CGAL NefPolyhedron->Polyhedron conversion failed");
- } else {
- ps = createPolySetFromPolyhedron(P);
- }
}
- catch (const CGAL::Precondition_exception &e) {
- PRINTB("CGAL Precondition error in CGAL_Nef_polyhedron::convertToPolyset(): %s", e.what());
+ catch (const CGAL::Failure_exception &e) {
+ err = true;
+ errmsg = std::string(e.what());
}
- catch (const CGAL::Assertion_exception &e) {
- PRINTB("CGAL Assertion error in CGAL_Nef_polyhedron::convertToPolyset(): %s", e.what());
- }
- catch (...) {
- PRINT("CGAL unknown error in CGAL_Nef_polyhedron::convertToPolyset()");
+ if (err) {
+ PRINT("ERROR: CGAL NefPolyhedron->Polyhedron conversion failed.");
+ if (errmsg!="") PRINTB("ERROR: %s",errmsg);
+ } else {
+ ps = createPolySetFromPolyhedron(P);
}
CGAL::set_error_behaviour(old_behaviour);
}
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 3d3aad1..731a418 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -800,6 +800,7 @@ list(APPEND CGALPNGTEST_FILES ${FEATURES_FILES} ${SCAD_DXF_FILES} ${EXAMPLE_FILE
list(APPEND CGALPNGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/include-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/use-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/transform-nan-inf-tests.scad
+ ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/stl-cgal-convert_to_Polyhedron-crash.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/localfiles-test.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/localfiles_dir/localfiles-compatibility-test.scad)
contact: Jan Huwald // Impressum