From ab6a2b71e8d40df4956626d758063f956229e218 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Tue, 14 Jan 2020 15:12:45 +0100 Subject: [PATCH] Another bugfixes of GCode export after refactoring. --- src/libslic3r/GCode/ToolOrdering.cpp | 5 ++--- src/libslic3r/GCodeWriter.cpp | 3 ++- src/libslic3r/GCodeWriter.hpp | 2 +- src/libslic3r/Print.hpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index 628379aaf..0b8fa1132 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -570,9 +570,8 @@ float WipingExtrusions::mark_wiping_extrusions(const Print& print, unsigned int const LayerTools& lt = *m_layer_tools; const float min_infill_volume = 0.f; // ignore infill with smaller volume than this - assert(volume_to_wipe >= 0.); - if (! this->something_overridable || volume_to_wipe == 0. || print.config().filament_soluble.get_at(old_extruder) || print.config().filament_soluble.get_at(new_extruder)) - return volume_to_wipe; // Soluble filament cannot be wiped in a random infill, neither the filament after it + if (! this->something_overridable || volume_to_wipe <= 0. || print.config().filament_soluble.get_at(old_extruder) || print.config().filament_soluble.get_at(new_extruder)) + return 0.f; // Soluble filament cannot be wiped in a random infill, neither the filament after it // we will sort objects so that dedicated for wiping are at the beginning: PrintObjectPtrs object_list = print.objects(); diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 0266eee39..4c53048dc 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -23,8 +23,9 @@ void GCodeWriter::apply_print_config(const PrintConfig &print_config) print_config.machine_max_acceleration_extruding.values.front() : 0); } -void GCodeWriter::set_extruders(const std::vector &extruder_ids) +void GCodeWriter::set_extruders(std::vector extruder_ids) { + std::sort(extruder_ids.begin(), extruder_ids.end()); m_extruders.clear(); m_extruders.reserve(extruder_ids.size()); for (unsigned int extruder_id : extruder_ids) diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 1631d8590..667c1ef95 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -33,7 +33,7 @@ public: std::string extrusion_axis() const { return m_extrusion_axis; } void apply_print_config(const PrintConfig &print_config); // Extruders are expected to be sorted in an increasing order. - void set_extruders(const std::vector &extruder_ids); + void set_extruders(std::vector extruder_ids); const std::vector& extruders() const { return m_extruders; } std::vector extruder_ids() const { std::vector out; diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index 89d27e3cb..42f8d761e 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -52,7 +52,7 @@ public: // Average diameter of nozzles participating on extruding this region. coordf_t bridging_height_avg(const PrintConfig &print_config) const; - // Collect extruder indices used to print this region's object. + // Collect 0-based extruder indices used to print this region's object. void collect_object_printing_extruders(std::vector &object_extruders) const; static void collect_object_printing_extruders(const PrintConfig &print_config, const PrintRegionConfig ®ion_config, std::vector &object_extruders);