From a1b3e660f1a8e8499682b41dce51e94c4f8c45d4 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Wed, 8 Nov 2023 13:41:19 +0100 Subject: [PATCH] Last tests and code cleaning --- src/FffGcodeWriter.cpp | 30 +++++++++++++----------------- src/PrimeTower.cpp | 2 -- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index c4d189f069..ca089df0c0 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -1400,6 +1400,19 @@ std::vector std::vector extruder_is_used_on_this_layer = storage.getExtrudersUsed(layer_nr); PrimeTowerMethod method = mesh_group_settings.get("prime_tower_mode"); + // check if we are on the first layer + if (layer_nr == -static_cast(Raft::getTotalExtraLayers())) + { + // check if we need prime blob on the first layer + for (size_t used_idx = 0; used_idx < extruder_is_used_on_this_layer.size(); used_idx++) + { + if (getExtruderNeedPrimeBlobDuringFirstLayer(storage, used_idx)) + { + extruder_is_used_on_this_layer[used_idx] = true; + } + } + } + // Make a temp list with the potential ordered extruders std::vector ordered_extruders; ordered_extruders.push_back(start_extruder); @@ -1465,23 +1478,6 @@ std::vector ret.front().prime = ExtruderPrime::Sparse; } -#warning restore this -#if 0 - // check if we are on the first layer - if ((mesh_group_settings.get("adhesion_type") == EPlatformAdhesion::RAFT && layer_nr == -static_cast(Raft::getTotalExtraLayers())) - || (mesh_group_settings.get("adhesion_type") != EPlatformAdhesion::RAFT && layer_nr == 0)) - { - // check if we need prime blob on the first layer - for (size_t used_idx = 0; used_idx < extruder_is_used_on_this_layer.size(); used_idx++) - { - if (getExtruderNeedPrimeBlobDuringFirstLayer(storage, used_idx)) - { - extruder_is_used_on_this_layer[used_idx] = true; - } - } - } -#endif - assert(ret.size() <= (size_t)extruder_count && "Not more extruders may be planned in a layer than there are extruders!"); return ret; } diff --git a/src/PrimeTower.cpp b/src/PrimeTower.cpp index 25eb173829..2ae24f4ea6 100644 --- a/src/PrimeTower.cpp +++ b/src/PrimeTower.cpp @@ -311,8 +311,6 @@ void PrimeTower::generateStartLocations() // so use the same start and end segments for this. PolygonsPointIndex segment_start = PolygonsPointIndex(&outer_poly, 0, 0); PolygonsPointIndex segment_end = segment_start; - -#warning Generate dots that are forcibly over a segment, even on sparse infill PolygonUtils::spreadDots(segment_start, segment_end, number_of_prime_tower_start_locations, prime_tower_start_locations); }