From aa854a5c99130bcb20d87f61e84fbae99b159de1 Mon Sep 17 00:00:00 2001 From: supermerill Date: Tue, 14 Jan 2020 17:10:29 +0100 Subject: [PATCH] bugfix "G1" alone in gcode. --- src/libslic3r/GCode/CoolingBuffer.cpp | 4 +++- src/libslic3r/Print.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index e85ba6d41..eec03d8dd 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -793,7 +793,9 @@ std::string CoolingBuffer::apply_layer_cooldown( // Roll the pointer before the 'F' word. for (f -= 2; f > line_start && (*f == ' ' || *f == '\t'); -- f); // Append up to the F word, without the trailing whitespace. - new_gcode.append(line_start, f - line_start + 1); + //but only if there are something else than a simple "G1" (F is always put at the end of a G1 command) + if(f - line_start > 2) + new_gcode.append(line_start, f - line_start + 1); } // Skip the non-whitespaces of the F parameter up the comment or end of line. for (; fpos != end && *fpos != ' ' && *fpos != ';' && *fpos != '\n'; ++fpos); diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index e0f86132c..d112ad215 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1255,7 +1255,7 @@ std::string Print::validate() const // #4043 if (total_copies_count > 1 && ! m_config.complete_objects.value) return L("The Spiral Vase option can only be used when printing a single object."); - assert(m_objects.size() == 1); + assert(m_objects.size() == 1 || config().complete_objects.value); size_t num_regions = 0; for (const std::vector> &volumes_per_region : m_objects.front()->region_volumes) if (! volumes_per_region.empty())