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);