diff options
author | Lukas Matena <lukasmatena@seznam.cz> | 2018-03-05 18:51:31 +0300 |
---|---|---|
committer | Lukas Matena <lukasmatena@seznam.cz> | 2018-03-05 18:51:31 +0300 |
commit | 6c223c2f8464f92462bdaadc70dbee822b69560f (patch) | |
tree | 2798a9f29f5ee15265edd5f7b42c7303880d82a5 /xs/src/libslic3r/GCode | |
parent | 4058f002751477b677d4f547eed1af459d7ea7ee (diff) |
Fixed cooling time calculation, removed unnecessary diagonal moves, fixed 'stringing' on start and end of narrower wipe tower layers
Diffstat (limited to 'xs/src/libslic3r/GCode')
-rw-r--r-- | xs/src/libslic3r/GCode/WipeTower.hpp | 2 | ||||
-rw-r--r-- | xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/xs/src/libslic3r/GCode/WipeTower.hpp b/xs/src/libslic3r/GCode/WipeTower.hpp index 289e8e122..e193fd972 100644 --- a/xs/src/libslic3r/GCode/WipeTower.hpp +++ b/xs/src/libslic3r/GCode/WipeTower.hpp @@ -17,7 +17,7 @@ public: struct xy { xy(float x = 0.f, float y = 0.f) : x(x), y(y) {} - xy(xy& pos,float xp,float yp) : x(pos.x+xp), y(pos.y+yp) {} + xy(const xy& pos,float xp,float yp) : x(pos.x+xp), y(pos.y+yp) {} xy operator+(const xy &rhs) const { xy out(*this); out.x += rhs.x; out.y += rhs.y; return out; } xy operator-(const xy &rhs) const { xy out(*this); out.x -= rhs.x; out.y -= rhs.y; return out; } xy& operator+=(const xy &rhs) { x += rhs.x; y += rhs.y; return *this; } diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp index f87db98a7..8e548a4a4 100644 --- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp +++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp @@ -93,8 +93,8 @@ public: float x() const { return m_current_pos.x; } float y() const { return m_current_pos.y; } const WipeTower::xy& pos() const { return m_current_pos; } - const WipeTower::xy start_pos_rotated() const { return m_start_pos.rotate(m_wipe_tower_pos, m_wipe_tower_width, m_wipe_tower_depth, m_angle_deg); } - const WipeTower::xy pos_rotated() const { return m_current_pos.rotate(m_wipe_tower_pos, m_wipe_tower_width, m_wipe_tower_depth, m_angle_deg); } + const WipeTower::xy start_pos_rotated() const { return WipeTower::xy(m_start_pos,0.f,m_y_shift).rotate(m_wipe_tower_pos, m_wipe_tower_width, m_wipe_tower_depth, m_angle_deg); } + const WipeTower::xy pos_rotated() const { return WipeTower::xy(m_current_pos,0.f,m_y_shift).rotate(m_wipe_tower_pos, m_wipe_tower_width, m_wipe_tower_depth, m_angle_deg); } float elapsed_time() const { return m_elapsed_time; } // Extrude with an explicitely provided amount of extrusion. @@ -882,7 +882,7 @@ void WipeTowerPrusaMM::toolchange_Unload( turning_point = ( xr-start_x > start_x-xl ? xr : xl ); const float max_x_dist = 2*std::abs(start_x-turning_point); const unsigned int N = 4 + std::max(0,(m_par.cooling_time[m_current_tool]-14)/3); - float time = m_par.cooling_time[m_current_tool] / N; + float time = m_par.cooling_time[m_current_tool] / float(N); i = 0; while (i<N) { @@ -891,8 +891,8 @@ void WipeTowerPrusaMM::toolchange_Unload( // this move is the last one at this speed or someone set tube_length to zero if (speed * time < 2*m_cooling_tube_length || m_cooling_tube_length<WT_EPSILON) { - ++i; - time = m_par.cooling_time[m_current_tool] / N; + ++i; + time = m_par.cooling_time[m_current_tool] / float(N); } else time -= e_dist / speed; // subtract time this part will really take @@ -1112,7 +1112,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::finish_layer(Purpose purpose) } } else { // The print head is inside the wipe tower. Rather move to the start of the following extrusion. - writer.set_initial_position(fill_box.ld); + writer.set_initial_position(fill_box.lu); } if (purpose == PURPOSE_EXTRUDE || purpose == PURPOSE_MOVE_TO_TOWER_AND_EXTRUDE) { @@ -1124,11 +1124,11 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::finish_layer(Purpose purpose) } else i=2; // only draw the inner perimeter - writer.travel(box.ld,7200) - .extrude(box.lu, 2400 * speed_factor) - .extrude(box.ru) + writer.travel(box.lu,7200) + .extrude(box.ru, 2400 * speed_factor) .extrude(box.rd) - .extrude(box.ld); + .extrude(box.ld) + .extrude(box.lu); } if (m_is_first_layer && m_par.adhesion) { |