diff options
author | bubnikv <bubnikv@gmail.com> | 2017-12-20 14:03:54 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2017-12-20 14:03:54 +0300 |
commit | c8d14fb6178f4feea906f1509e9988fceceb0e26 (patch) | |
tree | ad54c0eca8f0645d3098c4da3bc5348f19868b4c | |
parent | 558a0753c1a541a68e2cac7e61ed58e641bce8f8 (diff) |
The wipe tower generator does not call start_filament_gcode when
returning from a wipe tower and the particular wipe tower layer
is only sparsely filled without a tool change.
https://github.com/prusa3d/Slic3r/issues/642
-rw-r--r-- | xs/src/libslic3r/GCode.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/xs/src/libslic3r/GCode.cpp b/xs/src/libslic3r/GCode.cpp index 25fbc0139..47695a230 100644 --- a/xs/src/libslic3r/GCode.cpp +++ b/xs/src/libslic3r/GCode.cpp @@ -180,16 +180,16 @@ std::string WipeTowerIntegration::append_tcr(GCode &gcodegen, const WipeTower::T // Inform the G-code writer about the changes done behind its back. gcode += tcr.gcode; // Let the m_writer know the current extruder_id, but ignore the generated G-code. - if (new_extruder_id >= 0 && gcodegen.writer().need_toolchange(new_extruder_id)) { + if (new_extruder_id >= 0 && gcodegen.writer().need_toolchange(new_extruder_id)) gcodegen.writer().toolchange(new_extruder_id); - // Append the filament start G-code. - const std::string &start_filament_gcode = gcodegen.config().start_filament_gcode.get_at(new_extruder_id); - if (! start_filament_gcode.empty()) { - // Process the start_filament_gcode for the active filament only. - gcodegen.placeholder_parser().set("current_extruder", new_extruder_id); - gcode += gcodegen.placeholder_parser_process("start_filament_gcode", start_filament_gcode, new_extruder_id); - check_add_eol(gcode); - } + // Always append the filament start G-code even if the extruder did not switch, + // because the wipe tower resets the linear advance and we want it to be re-enabled. + const std::string &start_filament_gcode = gcodegen.config().start_filament_gcode.get_at(new_extruder_id); + if (! start_filament_gcode.empty()) { + // Process the start_filament_gcode for the active filament only. + gcodegen.placeholder_parser().set("current_extruder", new_extruder_id); + gcode += gcodegen.placeholder_parser_process("start_filament_gcode", start_filament_gcode, new_extruder_id); + check_add_eol(gcode); } // A phony move to the end position at the wipe tower. gcodegen.writer().travel_to_xy(Pointf(tcr.end_pos.x, tcr.end_pos.y)); |