diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index a087dd85407..f94a053483d 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -380,7 +380,7 @@ class ConfigOptionVector : public ConfigOptionVectorBase void set(const ConfigOption *rhs) override { if (rhs->type() != this->type()) - throw ConfigurationError("ConfigOptionVector: Assigning an incompatible type"); + throw ConfigurationError("ConfigOptionVector: Assigning an incompatible type"); assert(dynamic_cast*>(rhs)); this->values = static_cast*>(rhs)->values; } diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index db087a9bad4..66f606f2957 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -188,7 +188,7 @@ class WipeTowerWriter } WipeTowerWriter& extrude_explicit(const Vec2f &dest, float e, float f = 0.f, bool record_length = false, bool limit_volumetric_flow = true) - { return extrude_explicit(dest.x(), dest.y(), e, f, record_length); } + { return extrude_explicit(dest.x(), dest.y(), e, f, record_length, limit_volumetric_flow); } // Travel to a new XY position. f=0 means use the current value. WipeTowerWriter& travel(float x, float y, float f = 0.f) @@ -510,6 +510,8 @@ WipeTower::WipeTower(const PrintConfig& config, const std::vector cleaning_box.lu.y()-0.5f*m_perimeter_width) break; // in case next line would not fit - traversed_x -= writer.x(); - x_to_wipe -= std::abs(traversed_x); - if (x_to_wipe < WT_EPSILON) { + const float traversed_x = x_start - writer.x(); + x_wiped += std::abs(traversed_x); + if ((x_wiped + WT_EPSILON) >= x_wipe_target) { writer.travel(m_left_to_right ? xl + 1.5f*m_perimeter_width : xr - 1.5f*m_perimeter_width, writer.y(), 7200); break; } @@ -1078,7 +1085,7 @@ WipeTower::ToolChangeResult WipeTower::finish_layer() // Slow down on the 1st layer. bool first_layer = is_first_layer(); - float feedrate = first_layer ? m_first_layer_speed * 60.f : 2900.f; + float feedrate = first_layer ? m_first_layer_speed * 60.f : m_speed * 60.f; float current_depth = m_layer_info->depth - m_layer_info->toolchanges_depth(); box_coordinates fill_box(Vec2f(m_perimeter_width, m_layer_info->depth-(current_depth-m_perimeter_width)), m_wipe_tower_width - 2 * m_perimeter_width, current_depth-m_perimeter_width); diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 397b5ab7d8e..154ad07d171 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -261,8 +261,10 @@ class WipeTower size_t m_max_color_changes = 0; // Maximum number of color changes per layer. int m_old_temperature = -1; // To keep track of what was the last temp that we set (so we don't issue the command when not neccessary) float m_travel_speed = 0.f; - float m_first_layer_speed = 0.f; + float m_first_layer_speed = 0.f; // First layer speed in mm/s. size_t m_first_layer_idx = size_t(-1); + float m_speed = 0.f; // Wipe tower speed in mm/s. + float m_wipe_starting_speed = 0.f; // Starting speed during wipe, up to m_speed. // G-code generator parameters. float m_cooling_tube_retraction = 0.f; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 57386e7265c..0114ea0f326 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -445,7 +445,7 @@ static std::vector s_Preset_print_options { "perimeter_extrusion_width", "external_perimeter_extrusion_width", "infill_extrusion_width", "solid_infill_extrusion_width", "top_infill_extrusion_width", "support_material_extrusion_width", "infill_overlap", "infill_anchor", "infill_anchor_max", "bridge_flow_ratio", "clip_multipart_objects", "elefant_foot_compensation", "xy_size_compensation", "threads", "resolution", "gcode_resolution", "wipe_tower", "wipe_tower_x", "wipe_tower_y", - "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_bridging", "single_extruder_multi_material_priming", "mmu_segmented_region_max_width", + "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_bridging", "wipe_tower_speed", "wipe_tower_wipe_starting_speed", "single_extruder_multi_material_priming", "mmu_segmented_region_max_width", "wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits", "perimeter_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle", "wall_distribution_count", "min_feature_size", "min_bead_width" diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index de31301d8ef..a976df2a94a 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -196,6 +196,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "wipe_tower_brim_width" || opt_key == "wipe_tower_bridging" || opt_key == "wipe_tower_no_sparse_layers" + || opt_key == "wipe_tower_speed" + || opt_key == "wipe_tower_wipe_starting_speed" || opt_key == "wiping_volumes_matrix" || opt_key == "parking_pos_retraction" || opt_key == "cooling_tube_retraction" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 2dfd85d4f88..53c7e2d1ae0 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3042,6 +3042,20 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(10.)); + def = this->add("wipe_tower_speed", coFloat); + def->label = L("Speed"); + def->tooltip = L("Printing speed of the wipe tower. Capped by filament_max_volumetric_speed (if set)."); + def->sidetext = L("mm/s"); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(80.)); + + def = this->add("wipe_tower_wipe_starting_speed", coFloat); + def->label = L("Wipe starting speed"); + def->tooltip = L("Start of the wiping speed ramp up. Set to 0 to disable."); + def->sidetext = L("mm/s"); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(26.)); + def = this->add("xy_size_compensation", coFloat); def->label = L("XY Size Compensation"); def->category = L("Advanced"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index b188e499da0..dc848c38721 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -782,6 +782,8 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, wipe_tower_rotation_angle)) ((ConfigOptionFloat, wipe_tower_brim_width)) ((ConfigOptionFloat, wipe_tower_bridging)) + ((ConfigOptionFloat, wipe_tower_speed)) + ((ConfigOptionFloat, wipe_tower_wipe_starting_speed)) ((ConfigOptionFloats, wiping_volumes_matrix)) ((ConfigOptionFloats, wiping_volumes_extruders)) ((ConfigOptionFloat, z_offset)) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 13cc35008a7..bb3187d7efe 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -312,7 +312,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) bool have_wipe_tower = config->opt_bool("wipe_tower"); for (auto el : { "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_brim_width", - "wipe_tower_bridging", "wipe_tower_no_sparse_layers", "single_extruder_multi_material_priming" }) + "wipe_tower_bridging", "wipe_tower_no_sparse_layers", "single_extruder_multi_material_priming", "wipe_tower_speed", "wipe_tower_wipe_starting_speed"}) toggle_field(el, have_wipe_tower); bool have_avoid_crossing_perimeters = config->opt_bool("avoid_crossing_perimeters"); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 45884cc9d92..0b1e7af2aa2 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2004,7 +2004,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) , config(Slic3r::DynamicPrintConfig::new_from_defaults_keys({ "bed_shape", "bed_custom_texture", "bed_custom_model", "complete_objects", "duplicate_distance", "extruder_clearance_radius", "skirts", "skirt_distance", "brim_width", "brim_separation", "brim_type", "variable_layer_height", "nozzle_diameter", "single_extruder_multi_material", - "wipe_tower", "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_brim_width", + "wipe_tower", "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_speed", "wipe_tower_wipe_starting_speed", "extruder_colour", "filament_colour", "material_colour", "max_print_height", "printer_model", "printer_technology", // These values are necessary to construct SlicingParameters by the Canvas3D variable layer height editor. "layer_height", "first_layer_height", "min_layer_height", "max_layer_height", diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index c9090abd51e..9252b033eee 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1638,6 +1638,8 @@ void TabPrint::build() optgroup->append_single_option_line("wipe_tower_bridging"); optgroup->append_single_option_line("wipe_tower_no_sparse_layers"); optgroup->append_single_option_line("single_extruder_multi_material_priming"); + optgroup->append_single_option_line("wipe_tower_speed"); + optgroup->append_single_option_line("wipe_tower_wipe_starting_speed"); optgroup = page->new_optgroup(L("Advanced")); optgroup->append_single_option_line("interface_shells");