diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index 76b3d1b719..58e72d8019 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -1169,6 +1169,7 @@ FffGcodeWriter::ProcessLayerResult FffGcodeWriter::processLayer(const SliceDataS const Scene& scene = Application::getInstance().current_slice_->scene; + coord_t comb_offset_from_outlines = 0; coord_t avoid_distance = 0; // minimal avoid distance is zero const std::vector extruder_is_used = storage.getExtrudersUsed(); for (size_t extruder_nr = 0; extruder_nr < scene.extruders.size(); extruder_nr++) @@ -1181,6 +1182,8 @@ FffGcodeWriter::ProcessLayerResult FffGcodeWriter::processLayer(const SliceDataS { avoid_distance = std::max(avoid_distance, extruder.settings_.get("travel_avoid_distance")); } + + comb_offset_from_outlines = std::max(comb_offset_from_outlines, extruder.settings_.get("retraction_combing_avoid_distance")); } } @@ -1196,7 +1199,6 @@ FffGcodeWriter::ProcessLayerResult FffGcodeWriter::processLayer(const SliceDataS } max_inner_wall_width = std::max(max_inner_wall_width, mesh_inner_wall_width); } - const coord_t comb_offset_from_outlines = max_inner_wall_width * 2; const size_t first_extruder = findUsedExtruderIndex(storage, layer_nr, false); diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index 39f3e1b510..3587bd94a7 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -196,10 +196,10 @@ Shape LayerPlan::computeCombBoundary(const CombBoundary boundary_type) switch (boundary_type) { case CombBoundary::MINIMUM: - offset = -mesh.settings.get("machine_nozzle_size") / 2 - mesh.settings.get("wall_line_width_0") / 2 - extra_offset; + offset = -(mesh.settings.get("machine_nozzle_size") / 2 + mesh.settings.get("wall_line_width_0") / 2 + extra_offset); break; case CombBoundary::PREFERRED: - offset = -mesh.settings.get("machine_nozzle_size") * 3 / 2 - mesh.settings.get("wall_line_width_0") / 2 - extra_offset; + offset = -(mesh.settings.get("retraction_combing_avoid_distance") + mesh.settings.get("wall_line_width_0") / 2 + extra_offset); break; default: offset = 0;