From 60732fa664d8d7d3409c10b1b62743b6f932639e Mon Sep 17 00:00:00 2001 From: Pavel Mikus Date: Mon, 15 May 2023 10:48:54 +0200 Subject: [PATCH] Fix https://github.com/prusa3d/PrusaSlicer/issues/10563 Crashing of new ensuring fill due to zero vertical lines generated --- src/libslic3r/Fill/FillEnsuring.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Fill/FillEnsuring.cpp b/src/libslic3r/Fill/FillEnsuring.cpp index a64c0fd83..aa19bf09f 100644 --- a/src/libslic3r/Fill/FillEnsuring.cpp +++ b/src/libslic3r/Fill/FillEnsuring.cpp @@ -71,9 +71,11 @@ ThickPolylines make_fill_polylines( vertical_lines[i].a = Point{x, y_min}; vertical_lines[i].b = Point{x, y_max}; } - vertical_lines.push_back(vertical_lines.back()); - vertical_lines.back().a = Point{coord_t(bb.min.x() + n_vlines * double(scaled_spacing) + scaled_spacing * 0.5), y_min}; - vertical_lines.back().b = Point{vertical_lines.back().a.x(), y_max}; + if (vertical_lines.size() > 0) { + vertical_lines.push_back(vertical_lines.back()); + vertical_lines.back().a = Point{coord_t(bb.min.x() + n_vlines * double(scaled_spacing) + scaled_spacing * 0.5), y_min}; + vertical_lines.back().b = Point{vertical_lines.back().a.x(), y_max}; + } std::vector> polygon_sections(n_vlines);