MMU: Fixed missing travel to the wipe tower in one more case

This commit is contained in:
Lukas Matena 2023-01-26 20:44:38 +01:00
parent 38d5cb95fa
commit fd3ab55197
3 changed files with 8 additions and 4 deletions

View File

@ -236,10 +236,11 @@ namespace Slic3r {
const bool needs_toolchange = gcodegen.writer().need_toolchange(new_extruder_id);
const bool will_go_down = ! is_approx(z, current_z);
if (! needs_toolchange || (gcodegen.config().single_extruder_multi_material && ! tcr.priming)) {
if (tcr.force_travel || ! needs_toolchange || (gcodegen.config().single_extruder_multi_material && ! tcr.priming)) {
// Move over the wipe tower. If this is not single-extruder MM, the first wipe tower move following the
// toolchange will travel there anyway (if there is a toolchange).
// FIXME: It would be better if the wipe tower set the force_travel flag for all toolchanges,
// then we could simplify the condition and make it more readable.
gcode += gcodegen.retract();
gcodegen.m_avoid_crossing_perimeters.use_external_mp_once();
gcode += gcodegen.travel_to(
@ -265,7 +266,6 @@ namespace Slic3r {
deretraction_str = gcodegen.unretract();
}

View File

@ -1387,8 +1387,10 @@ void WipeTower::generate(std::vector<std::vector<WipeTower::ToolChangeResult>> &
layer_result.emplace_back(std::move(finish_layer_tcr));
}
else {
if (idx == -1)
if (idx == -1) {
layer_result[0] = merge_tcr(finish_layer_tcr, layer_result[0]);
layer_result[0].force_travel = true;
}
else
layer_result[idx] = merge_tcr(layer_result[idx], finish_layer_tcr);
}

View File

@ -82,6 +82,8 @@ public:
}
return e_length;
}
bool force_travel = false;
};
struct box_coordinates