From 993d6bd561baf57ad2e36c247a39759e2742b666 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 14 Mar 2023 11:11:51 +0100 Subject: [PATCH] Fixed a hang in tree supports, caused by integer overflow on coord_t. Fixes #10048 --- src/libslic3r/TreeSupport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/TreeSupport.cpp b/src/libslic3r/TreeSupport.cpp index 2ce4041614..240bcf7d10 100644 --- a/src/libslic3r/TreeSupport.cpp +++ b/src/libslic3r/TreeSupport.cpp @@ -1451,7 +1451,7 @@ static void generate_initial_areas( // As a circle is round this length is identical for every axis as long as the 90 degrees angle between both remains. const coord_t circle_length_to_half_linewidth_change = config.min_radius < config.support_line_width ? config.min_radius / 2 : - sqrt(sqr(config.min_radius) - sqr(config.min_radius - config.support_line_width / 2)); + scale_(sqrt(sqr(unscale(config.min_radius)) - sqr(unscale(config.min_radius - config.support_line_width / 2)))); // Extra support offset to compensate for larger tip radiis. Also outset a bit more when z overwrites xy, because supporting something with a part of a support line is better than not supporting it at all. //FIXME Vojtech: This is not sufficient for support enforcers to work. //FIXME There is no account for the support overhang angle.