From ecba2ca0074ecd05a8f40cf939aba0ef97aeab3d Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 30 Jun 2023 15:33:11 +0200 Subject: [PATCH] Wipe tower: increased purge flow parameter --- src/libslic3r/GCode/WipeTower.cpp | 4 ++++ src/libslic3r/GCode/WipeTower.hpp | 1 + src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 1 + src/libslic3r/PrintConfig.cpp | 9 +++++++++ src/libslic3r/PrintConfig.hpp | 1 + src/slic3r/GUI/ConfigManipulation.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 1 + 9 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 36da0e821d..1788017d8a 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -551,6 +551,7 @@ WipeTower::WipeTower(const PrintConfig& config, const PrintRegionConfig& default m_wipe_tower_brim_width(float(config.wipe_tower_brim_width)), m_wipe_tower_cone_angle(float(config.wipe_tower_cone_angle)), m_extra_spacing(float(config.wipe_tower_extra_spacing/100.)), + m_extra_flow(float(config.wipe_tower_extra_flow/100.)), m_y_shift(0.f), m_z_pos(0.f), m_bridging(float(config.wipe_tower_bridging)), @@ -1120,6 +1121,9 @@ void WipeTower::toolchange_Wipe( const float& xl = cleaning_box.ld.x(); const float& xr = cleaning_box.rd.x(); + // MATHIEU TEST: + writer.set_extrusion_flow(m_extrusion_flow * m_extra_flow); + // Variables x_to_wipe and traversed_x are here to be able to make sure it always wipes at least // the ordered volume, even if it means violating the box. This can later be removed and simply // wipe until the end of the assigned area. diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 608e9849c5..0807e6bb77 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -330,6 +330,7 @@ private: bool m_current_layer_finished = false; bool m_left_to_right = true; float m_extra_spacing = 1.f; + float m_extra_flow = 1.f; bool is_first_layer() const { return size_t(m_layer_info - m_plan.begin()) == m_first_layer_idx; } diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 3d5baee74c..4fd6d9d058 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -470,7 +470,7 @@ static std::vector s_Preset_print_options { "elefant_foot_compensation", "xy_size_compensation", "resolution", "gcode_resolution", "arc_fitting", "wipe_tower", "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_cone_angle", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_bridging", "single_extruder_multi_material_priming", "mmu_segmented_region_max_width", - "mmu_segmented_region_interlocking_depth", "wipe_tower_extruder", "wipe_tower_no_sparse_layers", "wipe_tower_extra_spacing", "compatible_printers", "compatible_printers_condition", "inherits", + "mmu_segmented_region_interlocking_depth", "wipe_tower_extruder", "wipe_tower_no_sparse_layers", "wipe_tower_extra_flow", "wipe_tower_extra_spacing", "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 4c3db4b657..615b91d6dc 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -242,6 +242,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "wipe_tower_cone_angle" || opt_key == "wipe_tower_bridging" || opt_key == "wipe_tower_extra_spacing" + || opt_key == "wipe_tower_extra_flow" || opt_key == "wipe_tower_no_sparse_layers" || opt_key == "wipe_tower_extruder" || opt_key == "wiping_volumes_matrix" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 5bd8b98bb7..2859d2cf21 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3361,6 +3361,15 @@ void PrintConfigDef::init_fff_params() def->max = 300.; def->set_default_value(new ConfigOptionPercent(100.)); + def = this->add("wipe_tower_extra_flow", coPercent); + def->label = L("MATHIEU TEST: extra flow"); + def->tooltip = L(""); + def->sidetext = L("%"); + def->mode = comExpert; + def->min = 100.; + def->max = 300.; + def->set_default_value(new ConfigOptionPercent(100.)); + def = this->add("wipe_into_infill", coBool); def->category = L("Wipe options"); def->label = L("Wipe into this object's infill"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 092aad5459..fc209c9b6a 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -878,6 +878,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, wipe_tower_brim_width)) ((ConfigOptionFloat, wipe_tower_cone_angle)) ((ConfigOptionPercent, wipe_tower_extra_spacing)) + ((ConfigOptionPercent, wipe_tower_extra_flow)) ((ConfigOptionFloat, wipe_tower_bridging)) ((ConfigOptionInt, wipe_tower_extruder)) ((ConfigOptionFloats, wiping_volumes_matrix)) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 013689ce63..3e8554885d 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -325,7 +325,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_cone_angle", - "wipe_tower_extra_spacing", "wipe_tower_bridging", "wipe_tower_no_sparse_layers", "single_extruder_multi_material_priming" }) + "wipe_tower_extra_spacing", "wipe_tower_extra_flow", "wipe_tower_bridging", "wipe_tower_no_sparse_layers", "single_extruder_multi_material_priming" }) toggle_field(el, have_wipe_tower); bool have_non_zero_mmu_segmented_region_max_width = config->opt_float("mmu_segmented_region_max_width") > 0.; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 2d00674c08..e74ba64cfc 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2127,7 +2127,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_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_extruder", + "wipe_tower", "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_extra_flow", "wipe_tower_extruder", "extruder_colour", "filament_colour", "material_colour", "max_print_height", "printer_model", "printer_notes", "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 db5305dd3b..7444f7d86a 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1655,6 +1655,7 @@ void TabPrint::build() optgroup->append_single_option_line("wipe_tower_bridging"); optgroup->append_single_option_line("wipe_tower_cone_angle"); optgroup->append_single_option_line("wipe_tower_extra_spacing"); + optgroup->append_single_option_line("wipe_tower_extra_flow"); optgroup->append_single_option_line("wipe_tower_no_sparse_layers"); optgroup->append_single_option_line("single_extruder_multi_material_priming");