FIX: missing nozzle volume type in old 3mf
jira: NONE Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: I95c85b54f13950a0859297dcb28edcb73d841276
This commit is contained in:
parent
f7ca47c2b3
commit
cfe3aad3fc
|
@ -3318,8 +3318,22 @@ int CLI::run(int argc, char **argv)
|
|||
std::vector<double>& flush_multipliers = m_print_config.option<ConfigOptionFloats>("flush_multiplier", true)->values;
|
||||
flush_multipliers.resize(new_extruder_count, 1.f);
|
||||
|
||||
ConfigOptionEnumsGeneric* nozzle_volume_opt = nullptr;
|
||||
if (m_print_config.has("nozzle_volume_type"))
|
||||
nozzle_volume_opt = m_print_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
|
||||
if (m_extra_config.has("nozzle_volume_type"))
|
||||
nozzle_volume_opt = m_extra_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
|
||||
|
||||
std::vector<NozzleVolumeType> volume_type_list;
|
||||
if (nozzle_volume_opt) {
|
||||
for (size_t idx = 0; idx < nozzle_volume_opt->values.size(); ++idx) {
|
||||
volume_type_list.emplace_back(NozzleVolumeType(nozzle_volume_opt->values[idx]));
|
||||
}
|
||||
}
|
||||
volume_type_list.resize(new_extruder_count, NozzleVolumeType::nvtStandard);
|
||||
|
||||
for (size_t nozzle_id = 0; nozzle_id < new_extruder_count; ++nozzle_id) {
|
||||
std::vector<double> flush_vol_mtx = get_flush_volumes_matrix(flush_vol_matrix, nozzle_id, new_extruder_count);
|
||||
std::vector<double> flush_vol_mtx = get_flush_volumes_matrix(flush_vol_matrix, nozzle_id, new_extruder_count);
|
||||
for (int from_idx = 0; from_idx < project_filament_count; from_idx++) {
|
||||
const std::string &from_color = project_filament_colors[from_idx];
|
||||
unsigned char from_rgb[4] = {};
|
||||
|
@ -3338,9 +3352,7 @@ int CLI::run(int argc, char **argv)
|
|||
unsigned char to_rgb[4] = {};
|
||||
Slic3r::GUI::BitmapCache::parse_color4(to_color, to_rgb);
|
||||
|
||||
NozzleVolumeType volume_type=NozzleVolumeType(m_print_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type")->values[nozzle_id]);
|
||||
Slic3r::FlushVolCalculator calculator(min_flush_volumes[from_idx], Slic3r::g_max_flush_volume, new_extruder_count > 1, volume_type);
|
||||
|
||||
Slic3r::FlushVolCalculator calculator(min_flush_volumes[from_idx], Slic3r::g_max_flush_volume, new_extruder_count > 1, volume_type_list[nozzle_id]);
|
||||
flushing_volume = calculator.calc_flush_vol(from_rgb[3], from_rgb[0], from_rgb[1], from_rgb[2], to_rgb[3], to_rgb[0], to_rgb[1], to_rgb[2]);
|
||||
if (is_from_support) { flushing_volume = std::max(Slic3r::g_min_flush_volume_from_support, flushing_volume); }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue