From dc2e7aeb4e03abec89724eed9b253d8d88e3f6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Mon, 21 Dec 2020 14:14:06 +0100 Subject: [PATCH] Fixed wrong generation of Adaptive Cubic and Support Cubic infill when infill extrusion width is set in percent. --- src/libslic3r/Fill/FillAdaptive.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/Fill/FillAdaptive.cpp b/src/libslic3r/Fill/FillAdaptive.cpp index 0865c3693..520124533 100644 --- a/src/libslic3r/Fill/FillAdaptive.cpp +++ b/src/libslic3r/Fill/FillAdaptive.cpp @@ -297,15 +297,16 @@ std::pair adaptive_fill_line_spacing(const PrintObject &print_ob double max_nozzle_diameter = *std::max_element(nozzle_diameters.begin(), nozzle_diameters.end()); double default_infill_extrusion_width = Flow::auto_extrusion_width(FlowRole::frInfill, float(max_nozzle_diameter)); for (const PrintRegion *region : print_object.print()->regions()) { - const PrintRegionConfig &config = region->config(); - bool nonempty = config.fill_density > 0; - bool has_adaptive_infill = nonempty && config.fill_pattern == ipAdaptiveCubic; - bool has_support_infill = nonempty && config.fill_pattern == ipSupportCubic; + const PrintRegionConfig &config = region->config(); + bool nonempty = config.fill_density > 0; + bool has_adaptive_infill = nonempty && config.fill_pattern == ipAdaptiveCubic; + bool has_support_infill = nonempty && config.fill_pattern == ipSupportCubic; + double infill_extrusion_width = config.infill_extrusion_width.percent ? default_infill_extrusion_width * 0.01 * config.infill_extrusion_width : config.infill_extrusion_width; region_fill_data.push_back(RegionFillData({ has_adaptive_infill ? Tristate::Maybe : Tristate::No, has_support_infill ? Tristate::Maybe : Tristate::No, config.fill_density, - config.infill_extrusion_width != 0. ? config.infill_extrusion_width : default_infill_extrusion_width + infill_extrusion_width != 0. ? infill_extrusion_width : default_infill_extrusion_width })); build_octree |= has_adaptive_infill || has_support_infill; }