From c49c0c8f723e82e4e87cd931b7d5070142fb0781 Mon Sep 17 00:00:00 2001 From: "xun.zhang" Date: Tue, 23 Jul 2024 11:40:24 +0800 Subject: [PATCH] ENH: modify forcast limit number 1.Use forcast when filament num in current layer and next layer both smaller than limit number jira:NEW Signed-off-by: xun.zhang Change-Id: Ia21bb22ce353f0c74eeaf748c6d9f9c4b315ec18 --- src/libslic3r/GCode/ToolOrdering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index 78d0136cd..2ae1460e6 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -213,7 +213,7 @@ int reorder_filaments_for_minimum_flush_volume(const std::vector&f std::optional&)>> get_custom_seq, std::vector>* filament_sequences) { - constexpr int max_n_with_forcast = 5; + constexpr int max_n_with_forcast = 7; int cost = 0; std::vector>groups(2); //save the grouped filaments std::vector>> layer_sequences(2); //save the reordered filament sequence by group @@ -282,7 +282,6 @@ int reorder_filaments_for_minimum_flush_volume(const std::vector&f // case with one group if (groups[idx].empty()) continue; - bool use_forcast = groups[idx].size() <= max_n_with_forcast; std::optionalcurrent_extruder_id; std::unordered_map>> caches; @@ -316,6 +315,7 @@ int reorder_filaments_for_minimum_flush_volume(const std::vector&f } } + bool use_forcast = (groups[0].size()<=max_n_with_forcast && groups[1].size()<=max_n_with_forcast) ; float tmp_cost = 0; std::vectorsequence; uint128_t hash_key = extruders_to_hash_key(filament_used_in_group, filament_used_in_group_next_layer, current_extruder_id, use_forcast);