Organic supports: Fixed division by zero for soluble supports

(with zero separation gap between object and supports)
Fixes #9555
This commit is contained in:
Vojtech Bubnik 2023-02-06 14:58:43 +01:00
parent 5de05294db
commit 7a873201d8

View File

@ -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. // 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. // The 2*z_distance_delta is only a catch for when the support angle is very high.
// Used only if not min_xy_dist. // Used only if not min_xy_dist.
const coord_t max_overhang_insert_lag = std::max<coord_t>(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<coord_t>(round_up_divide(mesh_config.xy_distance, max_overhang_speed / 2), 2 * mesh_config.z_distance_top_layers) :
0;
//FIXME //FIXME
size_t num_support_layers = print_object.layer_count(); size_t num_support_layers = print_object.layer_count();