From fc7e022003942512215a2ee8680674d1de3c06df Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 6 Mar 2017 16:32:14 +0100 Subject: [PATCH] Fixed regression: rectilinear infill crashed with zero-area polygons. #3648 --- xs/src/libslic3r/Fill/FillRectilinear.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xs/src/libslic3r/Fill/FillRectilinear.cpp b/xs/src/libslic3r/Fill/FillRectilinear.cpp index 69991db746..d27ea844cf 100644 --- a/xs/src/libslic3r/Fill/FillRectilinear.cpp +++ b/xs/src/libslic3r/Fill/FillRectilinear.cpp @@ -1,3 +1,4 @@ +#undef NDEBUG #include "../ClipperUtils.hpp" #include "../ExPolygon.hpp" #include "../PolylineCollection.hpp" @@ -28,6 +29,9 @@ FillRectilinear::_fill_single_direction(ExPolygon expolygon, // We ignore this->bounding_box because it doesn't matter; we're doing align_to_grid below. BoundingBox bounding_box = expolygon.contour.bounding_box(); + // Ignore too small expolygons. + if (bounding_box.size().x < min_spacing) return; + // Due to integer rounding, rotated polygons might not preserve verticality // (i.e. when rotating by PI/2 two points having the same x coordinate // they might get different y coordinates), thus the first line will be skipped.