mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
support has_single_extruder_multi_material_priming
This commit is contained in:
parent
b6a1a06c25
commit
1c68d58343
3 changed files with 33 additions and 35 deletions
|
@ -2180,16 +2180,13 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||||
// No object to print was found, cancel the G-code export.
|
// No object to print was found, cancel the G-code export.
|
||||||
throw Slic3r::SlicingError(_(L("No object can be printed. Maybe too small")));
|
throw Slic3r::SlicingError(_(L("No object can be printed. Maybe too small")));
|
||||||
has_wipe_tower = print.has_wipe_tower() && tool_ordering.has_wipe_tower();
|
has_wipe_tower = print.has_wipe_tower() && tool_ordering.has_wipe_tower();
|
||||||
// BBS: priming logic is removed, so 1st layer tool_ordering also respect the object tool sequence
|
// Orca: support all extruder priming
|
||||||
#if 0
|
|
||||||
initial_extruder_id = (has_wipe_tower && !print.config().single_extruder_multi_material_priming) ?
|
initial_extruder_id = (has_wipe_tower && !print.config().single_extruder_multi_material_priming) ?
|
||||||
// The priming towers will be skipped.
|
// The priming towers will be skipped.
|
||||||
tool_ordering.all_extruders().back() :
|
tool_ordering.all_extruders().back() :
|
||||||
// Don't skip the priming towers.
|
// Don't skip the priming towers.
|
||||||
tool_ordering.first_extruder();
|
tool_ordering.first_extruder();
|
||||||
#else
|
|
||||||
initial_extruder_id = tool_ordering.first_extruder();
|
|
||||||
#endif
|
|
||||||
//BBS: try to find the non-support filament extruder if is multi color and initial_extruder is support filament
|
//BBS: try to find the non-support filament extruder if is multi color and initial_extruder is support filament
|
||||||
if (initial_extruder_id != static_cast<unsigned int>(-1)) {
|
if (initial_extruder_id != static_cast<unsigned int>(-1)) {
|
||||||
initial_non_support_extruder_id = initial_extruder_id;
|
initial_non_support_extruder_id = initial_extruder_id;
|
||||||
|
@ -2270,7 +2267,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||||
this->placeholder_parser().set("current_object_idx", 0);
|
this->placeholder_parser().set("current_object_idx", 0);
|
||||||
// For the start / end G-code to do the priming and final filament pull in case there is no wipe tower provided.
|
// For the start / end G-code to do the priming and final filament pull in case there is no wipe tower provided.
|
||||||
this->placeholder_parser().set("has_wipe_tower", has_wipe_tower);
|
this->placeholder_parser().set("has_wipe_tower", has_wipe_tower);
|
||||||
//this->placeholder_parser().set("has_single_extruder_multi_material_priming", has_wipe_tower && print.config().single_extruder_multi_material_priming);
|
this->placeholder_parser().set("has_single_extruder_multi_material_priming", has_wipe_tower && print.config().single_extruder_multi_material_priming);
|
||||||
this->placeholder_parser().set("total_toolchanges", std::max(0, print.wipe_tower_data().number_of_toolchanges)); // Check for negative toolchanges (single extruder mode) and set to 0 (no tool change).
|
this->placeholder_parser().set("total_toolchanges", std::max(0, print.wipe_tower_data().number_of_toolchanges)); // Check for negative toolchanges (single extruder mode) and set to 0 (no tool change).
|
||||||
this->placeholder_parser().set("num_extruders", int(print.config().nozzle_diameter.values.size()));
|
this->placeholder_parser().set("num_extruders", int(print.config().nozzle_diameter.values.size()));
|
||||||
this->placeholder_parser().set("retract_length", new ConfigOptionFloats(print.config().retraction_length));
|
this->placeholder_parser().set("retract_length", new ConfigOptionFloats(print.config().retraction_length));
|
||||||
|
@ -2511,8 +2508,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// BBS: priming logic is removed, always set first extruer here.
|
// Orca: support extruder priming
|
||||||
//if (! (has_wipe_tower && print.config().single_extruder_multi_material_priming))
|
if (! (has_wipe_tower && print.config().single_extruder_multi_material_priming))
|
||||||
{
|
{
|
||||||
// Set initial extruder only after custom start G-code.
|
// Set initial extruder only after custom start G-code.
|
||||||
// Ugly hack: Do not set the initial extruder if the extruder is primed using the MMU priming towers at the edge of the print bed.
|
// Ugly hack: Do not set the initial extruder if the extruder is primed using the MMU priming towers at the edge of the print bed.
|
||||||
|
@ -2642,7 +2639,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||||
m_wipe_tower.reset(new WipeTowerIntegration(print.config(), print.get_plate_index(), print.get_plate_origin(), * print.wipe_tower_data().priming.get(), print.wipe_tower_data().tool_changes, *print.wipe_tower_data().final_purge.get()));
|
m_wipe_tower.reset(new WipeTowerIntegration(print.config(), print.get_plate_index(), print.get_plate_origin(), * print.wipe_tower_data().priming.get(), print.wipe_tower_data().tool_changes, *print.wipe_tower_data().final_purge.get()));
|
||||||
//BBS
|
//BBS
|
||||||
file.write(m_writer.travel_to_z(initial_layer_print_height + m_config.z_offset.value, "Move to the first layer height"));
|
file.write(m_writer.travel_to_z(initial_layer_print_height + m_config.z_offset.value, "Move to the first layer height"));
|
||||||
#if 0
|
|
||||||
if (print.config().single_extruder_multi_material_priming) {
|
if (print.config().single_extruder_multi_material_priming) {
|
||||||
file.write(m_wipe_tower->prime(*this));
|
file.write(m_wipe_tower->prime(*this));
|
||||||
// Verify, whether the print overaps the priming extrusions.
|
// Verify, whether the print overaps the priming extrusions.
|
||||||
|
@ -2667,19 +2664,17 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||||
file.write("M1 S10\n");
|
file.write("M1 S10\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//BBS: only support Marlin
|
else {
|
||||||
//else {
|
|
||||||
// This is not Marlin, M1 command is probably not supported.
|
// This is not Marlin, M1 command is probably not supported.
|
||||||
//if (overlap) {
|
if (overlap) {
|
||||||
// print.active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL,
|
print.active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL,
|
||||||
// _(L("Your print is very close to the priming regions. "
|
_(L("Your print is very close to the priming regions. "
|
||||||
// "Make sure there is no collision.")));
|
"Make sure there is no collision.")));
|
||||||
//} else {
|
} else {
|
||||||
// // Just continue printing, no action necessary.
|
// Just continue printing, no action necessary.
|
||||||
//}
|
}
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
print.throw_if_canceled();
|
print.throw_if_canceled();
|
||||||
}
|
}
|
||||||
// Process all layers of all objects (non-sequential mode) with a parallel pipeline:
|
// Process all layers of all objects (non-sequential mode) with a parallel pipeline:
|
||||||
|
|
|
@ -2061,14 +2061,6 @@ void Print::process(long long *time_cost_with_cache, bool use_cache)
|
||||||
tool_ordering = this->tool_ordering();
|
tool_ordering = this->tool_ordering();
|
||||||
tool_ordering.assign_custom_gcodes(*this);
|
tool_ordering.assign_custom_gcodes(*this);
|
||||||
has_wipe_tower = this->has_wipe_tower() && tool_ordering.has_wipe_tower();
|
has_wipe_tower = this->has_wipe_tower() && tool_ordering.has_wipe_tower();
|
||||||
//BBS: have no single_extruder_multi_material_priming
|
|
||||||
#if 0
|
|
||||||
initial_extruder_id = (has_wipe_tower && !this->config().single_extruder_multi_material_priming) ?
|
|
||||||
// The priming towers will be skipped.
|
|
||||||
tool_ordering.all_extruders().back() :
|
|
||||||
// Don't skip the priming towers.
|
|
||||||
tool_ordering.first_extruder();
|
|
||||||
#endif
|
|
||||||
initial_extruder_id = tool_ordering.first_extruder();
|
initial_extruder_id = tool_ordering.first_extruder();
|
||||||
print_object_instances_ordering = chain_print_object_instances(*this);
|
print_object_instances_ordering = chain_print_object_instances(*this);
|
||||||
append(printExtruders, tool_ordering.tools_for_layer(layers_to_print.front().first).extruders);
|
append(printExtruders, tool_ordering.tools_for_layer(layers_to_print.front().first).extruders);
|
||||||
|
@ -2581,9 +2573,19 @@ void Print::_make_wipe_tower()
|
||||||
for (unsigned int i = 0; i<number_of_extruders; ++i)
|
for (unsigned int i = 0; i<number_of_extruders; ++i)
|
||||||
wipe_volumes.push_back(std::vector<float>(flush_matrix.begin()+i*number_of_extruders, flush_matrix.begin()+(i+1)*number_of_extruders));
|
wipe_volumes.push_back(std::vector<float>(flush_matrix.begin()+i*number_of_extruders, flush_matrix.begin()+(i+1)*number_of_extruders));
|
||||||
|
|
||||||
|
// Orca: itertate over wipe_volumes and change the non-zero values to the prime_volume
|
||||||
|
if (!m_config.purge_in_prime_tower && !is_BBL_printer()) {
|
||||||
|
for (unsigned int i = 0; i < number_of_extruders; ++i) {
|
||||||
|
for (unsigned int j = 0; j < number_of_extruders; ++j) {
|
||||||
|
if (wipe_volumes[i][j] > 0) {
|
||||||
|
wipe_volumes[i][j] = m_config.prime_volume;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Let the ToolOrdering class know there will be initial priming extrusions at the start of the print.
|
// Let the ToolOrdering class know there will be initial priming extrusions at the start of the print.
|
||||||
// BBS: priming logic is removed, so don't consider it in tool ordering
|
m_wipe_tower_data.tool_ordering = ToolOrdering(*this, (unsigned int)-1, true);
|
||||||
m_wipe_tower_data.tool_ordering = ToolOrdering(*this, (unsigned int)-1, false);
|
|
||||||
|
|
||||||
if (!m_wipe_tower_data.tool_ordering.has_wipe_tower())
|
if (!m_wipe_tower_data.tool_ordering.has_wipe_tower())
|
||||||
// Don't generate any wipe tower.
|
// Don't generate any wipe tower.
|
||||||
|
@ -2734,13 +2736,13 @@ void Print::_make_wipe_tower()
|
||||||
for (size_t i = 0; i < number_of_extruders; ++i)
|
for (size_t i = 0; i < number_of_extruders; ++i)
|
||||||
wipe_tower.set_extruder(i, m_config);
|
wipe_tower.set_extruder(i, m_config);
|
||||||
|
|
||||||
// m_wipe_tower_data.priming = Slic3r::make_unique<std::vector<WipeTower::ToolChangeResult>>(
|
m_wipe_tower_data.priming = Slic3r::make_unique<std::vector<WipeTower::ToolChangeResult>>(
|
||||||
// wipe_tower.prime((float)this->skirt_first_layer_height(), m_wipe_tower_data.tool_ordering.all_extruders(), false));
|
wipe_tower.prime((float)this->skirt_first_layer_height(), m_wipe_tower_data.tool_ordering.all_extruders(), false));
|
||||||
|
|
||||||
// Lets go through the wipe tower layers and determine pairs of extruder changes for each
|
// Lets go through the wipe tower layers and determine pairs of extruder changes for each
|
||||||
// to pass to wipe_tower (so that it can use it for planning the layout of the tower)
|
// to pass to wipe_tower (so that it can use it for planning the layout of the tower)
|
||||||
{
|
{
|
||||||
unsigned int current_extruder_id = m_wipe_tower_data.tool_ordering.first_extruder();
|
unsigned int current_extruder_id = m_wipe_tower_data.tool_ordering.all_extruders().back();
|
||||||
for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) { // for all layers
|
for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) { // for all layers
|
||||||
if (!layer_tools.has_wipe_tower)
|
if (!layer_tools.has_wipe_tower)
|
||||||
continue;
|
continue;
|
||||||
|
@ -2748,7 +2750,7 @@ void Print::_make_wipe_tower()
|
||||||
wipe_tower.plan_toolchange((float) layer_tools.print_z, (float) layer_tools.wipe_tower_layer_height, current_extruder_id,
|
wipe_tower.plan_toolchange((float) layer_tools.print_z, (float) layer_tools.wipe_tower_layer_height, current_extruder_id,
|
||||||
current_extruder_id, false);
|
current_extruder_id, false);
|
||||||
for (const auto extruder_id : layer_tools.extruders) {
|
for (const auto extruder_id : layer_tools.extruders) {
|
||||||
if (/*(first_layer && extruder_id == m_wipe_tower_data.tool_ordering.all_extruders().back()) || */ extruder_id !=
|
if ((first_layer && extruder_id == m_wipe_tower_data.tool_ordering.all_extruders().back()) || extruder_id !=
|
||||||
current_extruder_id) {
|
current_extruder_id) {
|
||||||
float volume_to_wipe = m_config.prime_volume;
|
float volume_to_wipe = m_config.prime_volume;
|
||||||
if (m_config.purge_in_prime_tower) {
|
if (m_config.purge_in_prime_tower) {
|
||||||
|
|
|
@ -675,8 +675,9 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
||||||
|
|
||||||
bool purge_in_primetower = preset_bundle->printers.get_edited_preset().config.opt_bool("purge_in_prime_tower");
|
bool purge_in_primetower = preset_bundle->printers.get_edited_preset().config.opt_bool("purge_in_prime_tower");
|
||||||
|
|
||||||
|
// Orca: do we really need to hide these options when not purge_in_primetower?
|
||||||
for (auto el : {"wipe_tower_rotation_angle", "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_max_purge_speed", "wipe_tower_bridging", "wipe_tower_no_sparse_layers", "single_extruder_multi_material_priming"})
|
for (auto el : {"wipe_tower_rotation_angle", "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_max_purge_speed", "wipe_tower_bridging", "wipe_tower_no_sparse_layers", "single_extruder_multi_material_priming"})
|
||||||
toggle_line(el, have_prime_tower && purge_in_primetower);
|
toggle_line(el, have_prime_tower);
|
||||||
|
|
||||||
toggle_line("prime_volume",have_prime_tower && !purge_in_primetower);
|
toggle_line("prime_volume",have_prime_tower && !purge_in_primetower);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue