mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-18 19:15:57 +08:00
FIX: empty filament map
1.Caused by uninitialized filament map in mapping for AMS jira:NONE Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: I71ce6001fc6f2e72eb9303fcaba0bac16ad70dc9
This commit is contained in:
parent
1379b83846
commit
48023e4c15
@ -241,7 +241,7 @@ namespace Slic3r
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp_cost < ams_color_dist_threshold && tmp_cost < best_cost) {
|
if (best_map.empty() || (tmp_cost < ams_color_dist_threshold && tmp_cost < best_cost)) {
|
||||||
best_cost = tmp_cost;
|
best_cost = tmp_cost;
|
||||||
best_map = map;
|
best_map = map;
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
const static bool g_wipe_into_objects = false;
|
const static bool g_wipe_into_objects = false;
|
||||||
|
constexpr double similar_color_threshold_de2000 = 20.0;
|
||||||
|
|
||||||
static std::set<int>get_filament_by_type(const std::vector<unsigned int>& used_filaments, const PrintConfig* print_config, const std::string& type)
|
static std::set<int>get_filament_by_type(const std::vector<unsigned int>& used_filaments, const PrintConfig* print_config, const std::string& type)
|
||||||
{
|
{
|
||||||
@ -1002,7 +1003,7 @@ std::vector<int> ToolOrdering::get_recommended_filament_maps(const std::vector<s
|
|||||||
colors.emplace_back(item.option<ConfigOptionStrings>("filament_colour")->get_at(0));
|
colors.emplace_back(item.option<ConfigOptionStrings>("filament_colour")->get_at(0));
|
||||||
ams_colors[i] = std::move(colors);
|
ams_colors[i] = std::move(colors);
|
||||||
}
|
}
|
||||||
ret = select_best_group_for_ams(memoryed_maps, used_filaments, used_colors, ams_colors);
|
ret = select_best_group_for_ams(memoryed_maps, used_filaments, used_colors, ams_colors, similar_color_threshold_de2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user