From dd97eaa8125220f81fdd8a41c6ccddb1a743b068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Sun, 29 Nov 2020 17:26:02 +0100 Subject: [PATCH] Fixed case when lslices in Layer is empty --- src/libslic3r/GCode/AvoidCrossingPerimeters.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/AvoidCrossingPerimeters.cpp b/src/libslic3r/GCode/AvoidCrossingPerimeters.cpp index ff33813cf..ec5418348 100644 --- a/src/libslic3r/GCode/AvoidCrossingPerimeters.cpp +++ b/src/libslic3r/GCode/AvoidCrossingPerimeters.cpp @@ -491,7 +491,7 @@ static inline float get_default_perimeter_spacing(const PrintObject &print_objec assert(!printing_extruders.empty()); float avg_extruder = 0; for(unsigned int extruder_id : printing_extruders) - avg_extruder += scale_(print_object.print()->config().nozzle_diameter.get_at(extruder_id)); + avg_extruder += float(scale_(print_object.print()->config().nozzle_diameter.get_at(extruder_id))); avg_extruder /= printing_extruders.size(); return avg_extruder; } @@ -817,7 +817,7 @@ Polyline AvoidCrossingPerimeters::travel_to(const GCode &gcodegen, const Point & Vec2d startf = start.cast(); Vec2d endf = end .cast(); - if (!use_external && !any_expolygon_contains(gcodegen.layer()->lslices, gcodegen.layer()->lslices_bboxes, m_grid_lslice, travel)) { + if (!use_external && !gcodegen.layer()->lslices.empty() && !any_expolygon_contains(gcodegen.layer()->lslices, gcodegen.layer()->lslices_bboxes, m_grid_lslice, travel)) { // Initialize m_internal only when it is necessary. if (m_internal.boundaries.empty()) { m_internal.boundaries_params.clear();