From 1fdb9f72f0fa7c1e4398de2a3b96ade5fb35793b Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Wed, 26 Jun 2024 08:51:21 +0200 Subject: [PATCH] Fix wrong support infill in some cases support_line_distance with a value of 0 actually means no infill, which was currently interpreted with infinitely dense infill. CURA-11947 --- src/FffGcodeWriter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index ae03dfb305..ae7c7c2b07 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -3549,8 +3549,11 @@ bool FffGcodeWriter::processSupportInfill(const SliceDataStorage& storage, Layer = (part.custom_line_distance_ > 0 ? part.custom_line_distance_ : default_support_line_distance * density_factor); // the highest density infill combines with the next to create a grid with density_factor 1 - support_line_distance_here /= (1 << (infill_density_multiplier - 1)); - support_line_distance_here = std::max(support_line_distance_here, support_line_width); + if (support_line_distance_here != 0 && infill_density_multiplier > 1) + { + support_line_distance_here /= (1 << (infill_density_multiplier - 1)); + support_line_distance_here = std::max(support_line_distance_here, support_line_width); + } const int support_shift = support_line_distance_here / 2; if (part.custom_line_distance_ == 0 && (density_idx == max_density_idx || support_pattern == EFillMethod::CROSS || support_pattern == EFillMethod::CROSS_3D)) {