From 7a873201d808a1974fb587834459abc550bd10d5 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Mon, 6 Feb 2023 14:58:43 +0100 Subject: [PATCH] Organic supports: Fixed division by zero for soluble supports (with zero separation gap between object and supports) Fixes #9555 --- src/libslic3r/TreeSupport.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/TreeSupport.cpp b/src/libslic3r/TreeSupport.cpp index b0faa19dd..cbb779be0 100644 --- a/src/libslic3r/TreeSupport.cpp +++ b/src/libslic3r/TreeSupport.cpp @@ -923,7 +923,9 @@ static void generate_initial_areas( // does not turn valid in double the amount of layers a slope of support angle would take to travel xy_distance, nothing reasonable will come from it. // The 2*z_distance_delta is only a catch for when the support angle is very high. // Used only if not min_xy_dist. - const coord_t max_overhang_insert_lag = std::max(round_up_divide(mesh_config.xy_distance, max_overhang_speed / 2), 2 * mesh_config.z_distance_top_layers); + const coord_t max_overhang_insert_lag = mesh_config.z_distance_top_layers > 0 ? + std::max(round_up_divide(mesh_config.xy_distance, max_overhang_speed / 2), 2 * mesh_config.z_distance_top_layers) : + 0; //FIXME size_t num_support_layers = print_object.layer_count();