From aad9f61bada8bd1d71a201e00adbbe888f8bad26 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 22 May 2017 20:56:42 +0200 Subject: [PATCH] Wipe Tower: Fixed some ordering issue in the G-code writer. --- xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp index 7394b6acb..4c77bb171 100644 --- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp +++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp @@ -126,8 +126,9 @@ public: // extrude quickly amount e to x2 with feed f. Writer& ram(float x1, float x2, float dy, float e0, float e, float f) { - return extrude_explicit(x1, m_current_pos.y + dy, e0, f) - .extrude_explicit(x2, m_current_pos.y, e); + extrude_explicit(x1, m_current_pos.y + dy, e0, f); + extrude_explicit(x2, m_current_pos.y, e); + return *this; } // Let the end of the pulled out filament cool down in the cooling tube @@ -135,8 +136,9 @@ public: // at the current Y position to spread the leaking material. Writer& cool(float x1, float x2, float e1, float e2, float f) { - return extrude_explicit(x1, m_current_pos.y, e1, f) - .extrude_explicit(x2, m_current_pos.y, e2); + extrude_explicit(x1, m_current_pos.y, e1, f); + extrude_explicit(x2, m_current_pos.y, e2); + return *this; } Writer& set_tool(int tool) @@ -254,7 +256,7 @@ private: std::string set_format_F(float f) { char buf[64]; - sprintf(buf, " F%.0f", f); + sprintf(buf, " F%d", int(floor(f + 0.5f))); m_current_feedrate = f; return buf; } @@ -729,7 +731,7 @@ std::pair WipeTowerPrusaMM::finish_layer(Purpose pur ";------------------\n\n\n\n\n\n\n"); // Indicate that this wipe tower layer is fully covered. - m_idx_tool_change_in_layer = m_max_color_changes; + m_idx_tool_change_in_layer = (unsigned int)m_max_color_changes; } return std::pair(writer.gcode(), writer.pos());