bugfix: Empty import combined with real geometry caused an assert failure

master
Marius Kintel 2014-05-19 15:21:43 -04:00
parent 55fb525da9
commit e64734f8fd
6 changed files with 13 additions and 2 deletions

View File

@ -94,7 +94,7 @@ namespace CGALUtils {
}
// Initialize N with first expected geometric object
if (!N) {
N = chN->copy();;
N = chN->copy();
continue;
}
@ -1106,8 +1106,8 @@ void ZRemover::visit( CGAL_Nef_polyhedron3::Halffacet_const_handle hfacet )
static CGAL_Nef_polyhedron *createNefPolyhedronFromPolySet(const PolySet &ps)
{
assert(ps.getDimension() == 3);
if (ps.isEmpty()) return new CGAL_Nef_polyhedron();
assert(ps.getDimension() == 3);
CGAL_Nef_polyhedron3 *N = NULL;
bool plane_error = false;

View File

@ -0,0 +1,5 @@
// Testing that empty imports don't cause problems when mixed with real objects
difference() {
import();
cube();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,6 @@
group() {
difference() {
import(file = "", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
cube(size = [1, 1, 1], center = false);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB