From 7f5b45fade84f40943bb33f3f555bd8ca575c9c4 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Wed, 15 Nov 2023 14:07:59 +0100 Subject: [PATCH] Minor last prime tower layers optimizations --- src/FffGcodeWriter.cpp | 4 ++-- src/PrimeTower.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index 285bfa40bd..990f4dfa29 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -1470,7 +1470,7 @@ std::vector { prime = ExtruderPrime::Prime; } - else if (layer_nr < storage.max_print_height_second_to_last_extruder + 1) + else if (layer_nr < storage.max_print_height_second_to_last_extruder) { prime = ExtruderPrime::Sparse; } @@ -1491,7 +1491,7 @@ std::vector } } - if (method == PrimeTowerMethod::OPTIMIZED && ret.size() == 1 && ret.front().prime == ExtruderPrime::None) + if (method == PrimeTowerMethod::OPTIMIZED && ret.size() == 1 && ret.front().prime == ExtruderPrime::None && layer_nr <= storage.max_print_height_second_to_last_extruder) { ret.front().prime = ExtruderPrime::Sparse; } diff --git a/src/PrimeTower.cpp b/src/PrimeTower.cpp index 38cdadd286..094604ca0c 100644 --- a/src/PrimeTower.cpp +++ b/src/PrimeTower.cpp @@ -398,7 +398,7 @@ void PrimeTower::addToGcode( addToGcode_denseInfill(gcode_layer, new_extruder_nr); gcode_layer.setPrimeTowerIsPlanned(new_extruder_nr); - if (method == PrimeTowerMethod::OPTIMIZED && gcode_layer.getLayerNr() < storage.max_print_height_second_to_last_extruder) + if (method == PrimeTowerMethod::OPTIMIZED && gcode_layer.getLayerNr() <= storage.max_print_height_second_to_last_extruder) { // Whatever happens before and after, use the current extruder to prime all the non-required extruders now extra_primed_extruders_idx = findExtrudersSparseInfill(gcode_layer, required_extruder_prime, method);