Skip to content

Commit

Permalink
Minor last prime tower layers optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Nov 15, 2023
1 parent e29f675 commit 7f5b45f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/FffGcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ std::vector<ExtruderUse>
{
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;
}
Expand All @@ -1491,7 +1491,7 @@ std::vector<ExtruderUse>
}
}

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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/PrimeTower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7f5b45f

Please sign in to comment.