Fix of #8435 - Division by zero in lightning infill when automatic extrusion width was used.

This commit is contained in:
Lukáš Hejl 2022-06-29 18:33:01 +02:00
parent 5976dde2fc
commit 7783915a34

View File

@ -36,7 +36,9 @@ Generator::Generator(const PrintObject &print_object, const std::function<void()
// Note: There's not going to be a layer below the first one, so the 'initial layer height' doesn't have to be taken into account.
const double layer_thickness = scaled<double>(object_config.layer_height.value);
m_infill_extrusion_width = scaled<float>(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<float>(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