diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp index d7492fdbb..004aaf0de 100644 --- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp +++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.cpp @@ -31,8 +31,7 @@ TODO LIST #define strcasecmp _stricmp #endif -constexpr bool peters_wipe_tower = false; // sparse wipe tower inspired by Peter's post processor - not finished yet -constexpr float min_layer_difference = 2*m_perimeter_width; +const bool peters_wipe_tower = false; // sparse wipe tower inspired by Peter's post processor - not finished yet namespace Slic3r { @@ -468,7 +467,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::prime( // therefore the homing position is shifted inside the bed by 0.2 in the firmware to [0.2, -2.0]. // box_coordinates cleaning_box(xy(0.5f, - 1.5f), m_wipe_tower_width, wipe_area); //FIXME: set the width properly - constexpr float prime_section_width = 60.f; + const float prime_section_width = 60.f; box_coordinates cleaning_box(xy(5.f, 0.f), prime_section_width, 15.f); PrusaMultiMaterial::Writer writer; @@ -1191,18 +1190,6 @@ void WipeTowerPrusaMM::plan_toolchange(float z_par, float layer_height_par, unsi depth *= m_extra_spacing; m_plan.back().tool_changes.push_back(WipeTowerInfo::ToolChange(old_tool, new_tool, depth)); - - // Calculate m_wipe_tower_depth (maximum depth for all the layers) and propagate depths downwards - /*float this_layer_depth = m_plan.back().toolchanges_depth(); - m_plan.back().depth = this_layer_depth; - - if (this_layer_depth > m_wipe_tower_depth - m_perimeter_width) - m_wipe_tower_depth = this_layer_depth + m_perimeter_width; - for (int i = m_plan.size() - 2; i >= 0 && m_plan[i].depth < this_layer_depth; i-- ) { - if ( this_layer_depth - m_plan[i].depth < min_layer_difference && !m_plan[i].tool_changes.empty()) - m_plan[i].depth += this_layer_depth - m_plan[i].depth; - m_plan[i].depth = this_layer_depth; - }*/ } @@ -1224,7 +1211,7 @@ void WipeTowerPrusaMM::plan_tower() for (int i = layer_index - 1; i >= 0 /*&& m_plan[i].depth < this_layer_depth*/; i--) { - if (m_plan[i].depth - this_layer_depth < min_layer_difference ) + if (m_plan[i].depth - this_layer_depth < 2*m_perimeter_width ) m_plan[i].depth = this_layer_depth; } } diff --git a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp index 43163a73a..ef58f6c56 100644 --- a/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp +++ b/xs/src/libslic3r/GCode/WipeTowerPrusaMM.hpp @@ -10,22 +10,17 @@ #include "WipeTower.hpp" // Following is used to calculate extrusion flow - should be taken from config in future -constexpr float Filament_Area = M_PI * 1.75f * 1.75f / 4.f; // filament area in mm^3 -constexpr float Nozzle_Diameter = 0.4f; // nozzle diameter in mm +const float Filament_Area = M_PI * 1.75f * 1.75f / 4.f; // filament area in mm^3 +const float Nozzle_Diameter = 0.4f; // nozzle diameter in mm // desired line width (oval) in multiples of nozzle diameter - may not be actually neccessary to adjust -constexpr float Width_To_Nozzle_Ratio = 1.25f; +const float Width_To_Nozzle_Ratio = 1.25f; // m_perimeter_width was hardcoded until now as 0.5 (for 0.4 nozzle and 0.2 layer height) // FIXME m_perimeter_width is used in plan_toolchange - take care of proper initialization value when changing to variable -constexpr float Konst = 1.f; -constexpr float m_perimeter_width = Nozzle_Diameter * Width_To_Nozzle_Ratio * Konst; - -constexpr float WT_EPSILON = 1e-3f; - - - - +const float Konst = 1.f; +const float m_perimeter_width = Nozzle_Diameter * Width_To_Nozzle_Ratio * Konst; +const float WT_EPSILON = 1e-3f; namespace Slic3r @@ -147,14 +142,14 @@ struct WipeTowerParameters { ramming_speed.clear(); ramming_buttons.clear(); for (unsigned int i=0;i<4;++i) { - ramming_speed.push_back(std::vector{7.6, 7.6, 7.6, 7.6, 9.0, 9.0, 9.0, 10.7, 10.7, 10.7}); - ramming_buttons.push_back(std::vector>{{0.05, 6.6},{0.45, 6.8},{0.95, 7.8},{1.45, 8.3},{1.95, 9.7},{2.45,10},{2.95, 7.6},{3.45, 7.6},{3.95, 7.6},{4.45, 7.6},{4.95, 7.6}}); + ramming_speed.push_back(std::vector{7.6f, 7.6f, 7.6f, 7.6f, 9.f, 9.f, 9.f, 10.7f, 10.7f, 10.7f}); + ramming_buttons.push_back(std::vector>{{0.05f, 6.6f},{0.45f, 6.8f},{0.95f, 7.8f},{1.45f, 8.3f},{1.95f, 9.7f},{2.45f,10.f},{2.95f, 7.6f},{3.45f, 7.6f},{3.95f, 7.6f},{4.45f, 7.6f},{4.95f, 7.6f}}); } - wipe_volumes = {{ 0, 60, 60, 60}, - { 60, 0, 60, 60}, - { 60, 60, 0, 60}, - { 60, 60, 60, 0}}; - filament_wipe_volumes = {{30,30},{30,30},{30,30},{30,30}}; + wipe_volumes = {{ 0.f, 60.f, 60.f, 60.f}, + { 60.f, 0.f, 60.f, 60.f}, + { 60.f, 60.f, 0.f, 60.f}, + { 60.f, 60.f, 60.f, 0.f}}; + filament_wipe_volumes = {{30.f,30.f},{30.f,30.f},{30.f,30.f},{30.f,30.f}}; } int bridging = 0.f; diff --git a/xs/src/slic3r/GUI/RammingChart.hpp b/xs/src/slic3r/GUI/RammingChart.hpp index 5443e957a..5b7f6daf8 100644 --- a/xs/src/slic3r/GUI/RammingChart.hpp +++ b/xs/src/slic3r/GUI/RammingChart.hpp @@ -68,7 +68,7 @@ private: class ButtonToDrag { public: - bool operator<(ButtonToDrag& a) { return m_pos.m_x < a.m_pos.m_x; } + bool operator<(const ButtonToDrag& a) const { return m_pos.m_x < a.m_pos.m_x; } ButtonToDrag(wxPoint2DDouble pos) : m_pos{pos} {}; wxPoint2DDouble get_pos() const { return m_pos; } void move(double x,double y) { m_pos.m_x+=x; m_pos.m_y+=y; }