From 16bc9db06debf4f8776723ba39ae74710a098786 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Apr 2017 16:24:39 +0200 Subject: [PATCH] Simplify gradual infill steps maximum formula The case where it reaches '20' is incorrect, it should never give an error, so it should've been 999999 or something. This case is also overly complex. Say that P is 'infill_line_distance > 0' and Q is 'spaghetti_enabled'... Then it would be the logarithmic if (P and not Q)... Then it would be 0 or 20 if (not (P and not Q)), which is ((not P) or Q)... Then it would be 20 if (((not P) or Q) and not Q), which is (not P)... And it would be 0 if (((not P) or Q) and Q), which is Q. So therefore it can be simplified to: 20 if (not P) else 0 if Q else logarithmic. But 20 became 999999, hence the above formula. Contributes to issue CURA-3700. --- 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 b3ee3e4256..ca05191185 100755 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1301,7 +1301,7 @@ "type": "int", "minimum_value": "0", "maximum_value_warning": "4", - "maximum_value": "(20 - math.log(infill_line_distance) / math.log(2)) if infill_line_distance > 0 and not spaghetti_infill_enabled else (0 if spaghetti_infill_enabled else 20)", + "maximum_value": "0 if spaghetti_infill_enabled else (999999 if infill_line_distance == 0 else (20 - math.log(infill_line_distance) / math.log(2)))", "enabled": "infill_sparse_density > 0 and infill_pattern != 'cubicsubdiv' and not spaghetti_infill_enabled", "settable_per_mesh": true },