From 7783915a34c664d14e9e1a81d5da2c46282a33d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Wed, 29 Jun 2022 18:33:01 +0200 Subject: [PATCH] Fix of #8435 - Division by zero in lightning infill when automatic extrusion width was used. --- src/libslic3r/Fill/Lightning/Generator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/Fill/Lightning/Generator.cpp b/src/libslic3r/Fill/Lightning/Generator.cpp index 75ca5583e..ce527d351 100644 --- a/src/libslic3r/Fill/Lightning/Generator.cpp +++ b/src/libslic3r/Fill/Lightning/Generator.cpp @@ -36,7 +36,9 @@ Generator::Generator(const PrintObject &print_object, const std::function(object_config.layer_height.value); - m_infill_extrusion_width = scaled(region_config.infill_extrusion_width.percent ? default_infill_extrusion_width * 0.01 * region_config.infill_extrusion_width : region_config.infill_extrusion_width); + m_infill_extrusion_width = scaled(region_config.infill_extrusion_width.percent ? default_infill_extrusion_width * 0.01 * region_config.infill_extrusion_width : + region_config.infill_extrusion_width != 0. ? region_config.infill_extrusion_width : + default_infill_extrusion_width); m_supporting_radius = coord_t(m_infill_extrusion_width) * 100 / coord_t(region_config.fill_density.value); const double lightning_infill_overhang_angle = M_PI / 4; // 45 degrees