mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-02-07 04:11:50 +03:00
update slic3r
This commit is contained in:
@@ -3539,19 +3539,36 @@ 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<int> nozzle_flush_dataset(new_extruder_count, 0);
|
||||
{
|
||||
std::vector<int> nozzle_flush_dataset_full = m_print_config.option<ConfigOptionIntsNullable>("nozzle_flush_dataset",true)->values;
|
||||
if (m_print_config.has("printer_extruder_variant"))
|
||||
nozzle_flush_dataset_full.resize(m_print_config.option<ConfigOptionStrings>("printer_extruder_variant")->size(), 0);
|
||||
else
|
||||
nozzle_flush_dataset_full.resize(1, 0);
|
||||
|
||||
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]));
|
||||
std::vector<int> extruders;
|
||||
if (m_print_config.has("extruder_type"))
|
||||
extruders = m_print_config.option<ConfigOptionEnumsGeneric>("extruder_type")->values;
|
||||
else
|
||||
extruders.resize(1,int(ExtruderType::etDirectDrive));
|
||||
|
||||
std::vector<int> volume_types;
|
||||
if (m_print_config.has("nozzle_volume_type"))
|
||||
volume_types = m_print_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type")->values; // get volume type from 3mf
|
||||
else
|
||||
volume_types.resize(1, int(NozzleVolumeType::nvtStandard));
|
||||
|
||||
if(m_extra_config.has("nozzle_volume_type")) // get volume type from input
|
||||
volume_types = m_extra_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type")->values;
|
||||
|
||||
for (int eidx = 0; eidx < new_extruder_count; ++eidx) {
|
||||
int index = 0;
|
||||
if (m_print_config.has("printer_extruder_id") && m_print_config.has("printer_extruder_variant"))
|
||||
index = m_print_config.get_index_for_extruder(eidx + 1, "printer_extruder_id", ExtruderType(extruders[eidx]), NozzleVolumeType(volume_types[eidx]), "printer_extruder_variant");
|
||||
nozzle_flush_dataset[eidx] = nozzle_flush_dataset_full[index];
|
||||
}
|
||||
}
|
||||
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);
|
||||
@@ -3573,7 +3590,7 @@ int CLI::run(int argc, char **argv)
|
||||
unsigned char to_rgb[4] = {};
|
||||
Slic3r::GUI::BitmapCache::parse_color4(to_color, to_rgb);
|
||||
|
||||
Slic3r::FlushVolCalculator calculator(min_flush_volumes[from_idx], Slic3r::g_max_flush_volume, new_extruder_count > 1, volume_type_list[nozzle_id]);
|
||||
Slic3r::FlushVolCalculator calculator(min_flush_volumes[from_idx], Slic3r::g_max_flush_volume,nozzle_flush_dataset[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); }
|
||||
}
|
||||
@@ -4901,6 +4918,37 @@ int CLI::run(int argc, char **argv)
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << boost::format("plate %1%: no arrange, directly translate object %2% by {%3%, %4%}") % (i+1) % mo->name %plate_origin(0) %plate_origin(1);
|
||||
}
|
||||
|
||||
bool is_seq_print = false;
|
||||
get_print_sequence(cur_plate, m_print_config, is_seq_print);
|
||||
|
||||
if (!is_seq_print && assemble_plate.filaments_count > 1)
|
||||
{
|
||||
//prepare the wipe tower
|
||||
auto printer_structure_opt = m_print_config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure");
|
||||
// set the default position, the same with print config(left top)
|
||||
float x = WIPE_TOWER_DEFAULT_X_POS;
|
||||
float y = WIPE_TOWER_DEFAULT_Y_POS;
|
||||
if (printer_structure_opt && printer_structure_opt->value == PrinterStructure::psI3) {
|
||||
x = I3_WIPE_TOWER_DEFAULT_X_POS;
|
||||
y = I3_WIPE_TOWER_DEFAULT_Y_POS;
|
||||
}
|
||||
if (x < WIPE_TOWER_MARGIN) {
|
||||
x = WIPE_TOWER_MARGIN;
|
||||
}
|
||||
if (y < WIPE_TOWER_MARGIN) {
|
||||
y = WIPE_TOWER_MARGIN;
|
||||
}
|
||||
|
||||
//create the options using default if neccessary
|
||||
ConfigOptionFloats* wipe_x_option = m_print_config.option<ConfigOptionFloats>("wipe_tower_x", true);
|
||||
ConfigOptionFloats* wipe_y_option = m_print_config.option<ConfigOptionFloats>("wipe_tower_y", true);
|
||||
ConfigOptionFloat wt_x_opt(x);
|
||||
ConfigOptionFloat wt_y_opt(y);
|
||||
|
||||
wipe_x_option->set_at(&wt_x_opt, i, 0);
|
||||
wipe_y_option->set_at(&wt_y_opt, i, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user