mirror of https://github.com/vitalif/openscad
simplify nef polyhedron code. attempt to add test for bug
parent
cf9f19818c
commit
faf008ce24
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue