From 77cc088b643ff65a11ec63aaa41149380bfda3b2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 16 Dec 2016 10:22:16 +0100 Subject: [PATCH] Correct Prime Tower Wall Thickness for if prime_tower_size == 0 If the prime tower size was too small, it would try to take the root of a negative number. Now we just clamp that computation to 0, which is the correct behaviour for when the minimum volume doesn't fit in the prime tower. Contributes to issue CURA-3148. --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 7725940553..e81d3e7dd6 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3755,7 +3755,7 @@ "unit": "mm", "type": "float", "default_value": 2, - "value": "max(2 * min(extruderValues('prime_tower_line_width')), 0.5 * (resolveOrValue('prime_tower_size') - math.sqrt(resolveOrValue('prime_tower_size') ** 2 - max(extruderValues('prime_tower_min_volume')) / resolveOrValue('layer_height'))))", + "value": "max(2 * min(extruderValues('prime_tower_line_width')), 0.5 * (resolveOrValue('prime_tower_size') - math.sqrt(resolveOrValue('prime_tower_size') ** 2 - max(extruderValues('prime_tower_min_volume')) / resolveOrValue('layer_height')) if (resolveOrValue('prime_tower_size') ** 2 > max(extruderValues('prime_tower_min_volume')) / resolveOrValue('layer_height')) else 0))", "resolve": "max(extruderValues('prime_tower_wall_thickness'))", "minimum_value": "0.001", "minimum_value_warning": "2 * min(extruderValues('prime_tower_line_width'))",