From 3a979903aa5fe0a0a6346244a982356d0e6e27ff Mon Sep 17 00:00:00 2001 From: John Hryb IV Date: Tue, 19 Feb 2019 23:40:36 -0500 Subject: [PATCH 01/23] PostProcessingPlugin Script for 2-1 Dual Extruders - ColorMix 2-1 Marlin Commands: M163 - Set Mix Factor M164 - Save Mix Ability to set a mix ratio or blend at a defined layer or distance. Based on Geeetech's Color mixing software. --- .../PostProcessingPlugin/scripts/ColorMix.py | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 plugins/PostProcessingPlugin/scripts/ColorMix.py diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py new file mode 100644 index 0000000000..af64ea2764 --- /dev/null +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -0,0 +1,190 @@ +# ColorMix script - 2-1 extruder color mix and blending +# This script is specific for the Geeetech A10M dual extruder but should work with other Marlin printers. +# It runs with the PostProcessingPlugin which is released under the terms of the AGPLv3 or higher. +# This script is licensed under the Creative Commons - Attribution - Share Alike (CC BY-SA) terms + +#Authors of the 2-1 ColorMix plug-in / script: +# Written by John Hryb - john.hryb.4@gmail.com + +##history / change-log: +##V1.0.0 + +## Uses - +## M163 - Set Mix Factor +## M164 - Save Mix - saves to T3 as a unique mix + +import re #To perform the search and replace. +from ..Script import Script + +class ColorMix(Script): + def __init__(self): + super().__init__() + + def getSettingDataString(self): + return """{ + "name":"ColorMix 2-1", + "key":"ColorMix 2-1", + "metadata": {}, + "version": 2, + "settings": + { + "a_unitsOfMeasurement": + { + "label": "Units of measurement", + "description": "Input value as mm or layer number.", + "type": "enum", + "options": {"mm":"mm","layer":"Layer"}, + "default_value": "layer" + }, + "b_start_height": + { + "label": "Start Height", + "description": "Value to start at (mm or layer)", + "type": "float", + "default_value": 0, + "minimum_value": "0" + }, + "c_behavior": + { + "label": "Fixed or blend", + "description": "Select Fixed (set new mixture) or Blend mode (dynamic mix)", + "type": "enum", + "options": {"fixed_value":"Fixed","blend_value":"Blend"}, + "default_value": "fixed_value" + }, + "d_finish_height": + { + "label": "Finish Height", + "description": "Value to stop at (mm or layer)", + "type": "float", + "default_value": 0, + "minimum_value": "0", + "minimum_value_warning": "0.1", + "enabled": "c_behavior == 'blend_value'" + }, + "e_mix_start": + { + "label": "Start mix ratio", + "description": "First extruder percentage 0-100", + "type": "float", + "default_value": 100, + "minimum_value": "0", + "minimum_value_warning": "0", + "maximum_value_warning": "100" + }, + "f_mix_finish": + { + "label": "End mix ratio", + "description": "First extruder percentage 0-100 to finish blend", + "type": "float", + "default_value": 0, + "minimum_value": "0", + "minimum_value_warning": "0", + "maximum_value_warning": "100", + "enabled": "c_behavior == 'blend_value'" + }, + "g_notes": + { + "label": "Notes", + "description": "A spot to put a note", + "type": "str", + "default_value": "" + } + } + }""" + def getValue(self, line, key, default = None): #replace default getvalue due to comment-reading feature + if not key in line or (";" in line and line.find(key) > line.find(";") and + not ";ChangeAtZ" in key and not ";LAYER:" in key): + return default + subPart = line[line.find(key) + len(key):] #allows for string lengths larger than 1 + if ";ChangeAtZ" in key: + m = re.search("^[0-4]", subPart) + elif ";LAYER:" in key: + m = re.search("^[+-]?[0-9]*", subPart) + else: + #the minus at the beginning allows for negative values, e.g. for delta printers + m = re.search("^[-]?[0-9]*\.?[0-9]*", subPart) + if m == None: + return default + try: + return float(m.group(0)) + except: + return default + + def execute(self, data): + #get user variables + firstHeight = 0.0 + secondHeight = 0.0 + firstMix = 0.0 + SecondMix = 0.0 + + firstHeight = self.getSettingValueByKey("b_start_height") + secondHeight = self.getSettingValueByKey("d_finish_height") + firstMix = self.getSettingValueByKey("e_mix_start") + SecondMix = self.getSettingValueByKey("f_mix_finish") + + #locals + layer = 0 + + #get layer height + layerHeight = .2 + for active_layer in data: + lines = active_layer.split("\n") + for line in lines: + if ";Layer height: " in line: + layerHeight = self.getValue(line, ";Layer height: ", layerHeight) + break + #get layers to use + startLayer = 0 + endLayer = 0 + if self.getSettingValueByKey("a_unitsOfMeasurement") == "mm": + if firstHeight == 0: + startLayer = 0 + else: + startLayer = firstHeight / layerHeight + if secondHeight == 0: + endLayer = 0 + else: + endLayer = secondHeight / layerHeight + else: #layer height + startLayer = firstHeight + endLayer = secondHeight + #see if one-shot + if self.getSettingValueByKey("c_behavior") == "fixed_value": + endLayer = startLayer + firstExtruderIncrements = 0 + else: #blend + firstExtruderIncrements = (SecondMix - firstMix) / (endLayer - startLayer) + firstExtruderValue = 0 + index = 0 + #start scanning + for active_layer in data: + modified_gcode = "" + lineIndex = 0; + lines = active_layer.split("\n") + for line in lines: + #dont leave blanks + if line != "": + modified_gcode += line + "\n" + # find current layer + if ";LAYER:" in line: + layer = self.getValue(line, ";LAYER:", layer) + if (layer >= startLayer) and (layer <= endLayer): #find layers of interest + if lines[lineIndex + 4] == "T2": #check if needing to delete old data + del lines[(lineIndex + 1):(lineIndex + 5)] + firstExtruderValue = int(((layer - startLayer) * firstExtruderIncrements) + firstMix) + if firstExtruderValue == 100: + modified_gcode += "M163 S0 P1\n" + modified_gcode += "M163 S1 P0\n" + elif firstExtruderValue == 0: + modified_gcode += "M163 S0 P0\n" + modified_gcode += "M163 S1 P1\n" + else: + modified_gcode += "M163 S0 P0.{:02d}\n".format(firstExtruderValue) + modified_gcode += "M163 S1 P0.{:02d}\n".format(100 - firstExtruderValue) + modified_gcode += "M164 S2\n" + modified_gcode += "T2\n" + lineIndex += 1 #for deleting index + data[index] = modified_gcode + index += 1 + return data \ No newline at end of file From 9fae1f29b15f77bfc17a4b2a36cd57ba3d30b1b6 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:40:11 -0500 Subject: [PATCH 02/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py Sure Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index af64ea2764..a923918caa 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -28,7 +28,7 @@ class ColorMix(Script): "version": 2, "settings": { - "a_unitsOfMeasurement": + "measurement_units": { "label": "Units of measurement", "description": "Input value as mm or layer number.", @@ -187,4 +187,4 @@ class ColorMix(Script): lineIndex += 1 #for deleting index data[index] = modified_gcode index += 1 - return data \ No newline at end of file + return data From 7921b89f3e44109471f9c1c0d87d6527c88131ff Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:40:36 -0500 Subject: [PATCH 03/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py Sure Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index a923918caa..766a81efd8 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -36,7 +36,7 @@ class ColorMix(Script): "options": {"mm":"mm","layer":"Layer"}, "default_value": "layer" }, - "b_start_height": + "start_height": { "label": "Start Height", "description": "Value to start at (mm or layer)", From 986f9aa248271bb2ad66d77775d2551f16aef79d Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:41:00 -0500 Subject: [PATCH 04/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py Sure Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index 766a81efd8..1dc2796c8b 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -44,7 +44,7 @@ class ColorMix(Script): "default_value": 0, "minimum_value": "0" }, - "c_behavior": + "behavior": { "label": "Fixed or blend", "description": "Select Fixed (set new mixture) or Blend mode (dynamic mix)", From ad820ad1e99f90fa2be12befb71e3e73b7f2de00 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:41:35 -0500 Subject: [PATCH 05/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py Okay Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index 1dc2796c8b..7d36ee60fd 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -52,7 +52,7 @@ class ColorMix(Script): "options": {"fixed_value":"Fixed","blend_value":"Blend"}, "default_value": "fixed_value" }, - "d_finish_height": + "finish_height": { "label": "Finish Height", "description": "Value to stop at (mm or layer)", From 8086adf9ba63b6fb3ec18fffa1cac2401eb3f60f Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:41:54 -0500 Subject: [PATCH 06/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py Okay Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index 7d36ee60fd..4ffb17b2a5 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -62,7 +62,7 @@ class ColorMix(Script): "minimum_value_warning": "0.1", "enabled": "c_behavior == 'blend_value'" }, - "e_mix_start": + "mix_start_ratio": { "label": "Start mix ratio", "description": "First extruder percentage 0-100", From 87154238a18fc80dafd3a474f420f4fb9bc51f87 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:42:40 -0500 Subject: [PATCH 07/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py Okay Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index 4ffb17b2a5..8a89c3bc20 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -72,7 +72,7 @@ class ColorMix(Script): "minimum_value_warning": "0", "maximum_value_warning": "100" }, - "f_mix_finish": + "mix_finish_ratio": { "label": "End mix ratio", "description": "First extruder percentage 0-100 to finish blend", From 151d40664f28730bd84f780b88d263bdda5e9f71 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:45:18 -0500 Subject: [PATCH 08/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py It's not functional, just a spot to put info if needed. Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index 8a89c3bc20..e12b011ab2 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -83,7 +83,7 @@ class ColorMix(Script): "maximum_value_warning": "100", "enabled": "c_behavior == 'blend_value'" }, - "g_notes": + "notes": { "label": "Notes", "description": "A spot to put a note", From 186e715d1657764559c3e58752af3b3bc0ff5c2b Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:45:34 -0500 Subject: [PATCH 09/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py Okay Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index e12b011ab2..252384473f 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -118,7 +118,7 @@ class ColorMix(Script): firstMix = 0.0 SecondMix = 0.0 - firstHeight = self.getSettingValueByKey("b_start_height") + firstHeight = self.getSettingValueByKey("start_height") secondHeight = self.getSettingValueByKey("d_finish_height") firstMix = self.getSettingValueByKey("e_mix_start") SecondMix = self.getSettingValueByKey("f_mix_finish") From fadc8bb6243bb6a6c66a805cbec44409c89a90c8 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:45:49 -0500 Subject: [PATCH 10/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py Sure Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index 252384473f..bb94b066df 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -119,7 +119,7 @@ class ColorMix(Script): SecondMix = 0.0 firstHeight = self.getSettingValueByKey("start_height") - secondHeight = self.getSettingValueByKey("d_finish_height") + secondHeight = self.getSettingValueByKey("finish_height") firstMix = self.getSettingValueByKey("e_mix_start") SecondMix = self.getSettingValueByKey("f_mix_finish") From d19f1f497a308ec8085864863ecedf6f9dd6f9bd Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:46:00 -0500 Subject: [PATCH 11/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py Okay Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index bb94b066df..888ac6dd9a 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -120,7 +120,7 @@ class ColorMix(Script): firstHeight = self.getSettingValueByKey("start_height") secondHeight = self.getSettingValueByKey("finish_height") - firstMix = self.getSettingValueByKey("e_mix_start") + firstMix = self.getSettingValueByKey("mix_start_ratio") SecondMix = self.getSettingValueByKey("f_mix_finish") #locals From 0875498a1266c628cbd451f89342aef31ccd88b7 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:46:20 -0500 Subject: [PATCH 12/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py Sure Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index 888ac6dd9a..9cc9b703d0 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -121,7 +121,7 @@ class ColorMix(Script): firstHeight = self.getSettingValueByKey("start_height") secondHeight = self.getSettingValueByKey("finish_height") firstMix = self.getSettingValueByKey("mix_start_ratio") - SecondMix = self.getSettingValueByKey("f_mix_finish") + SecondMix = self.getSettingValueByKey("mix_finish_ratio") #locals layer = 0 From 3b763e5552aa94e1f7951bb97360dca8ee4bcdee Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:46:34 -0500 Subject: [PATCH 13/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py OKay Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index 9cc9b703d0..4a2ff718bb 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -137,7 +137,7 @@ class ColorMix(Script): #get layers to use startLayer = 0 endLayer = 0 - if self.getSettingValueByKey("a_unitsOfMeasurement") == "mm": + if self.getSettingValueByKey("measurement_units") == "mm": if firstHeight == 0: startLayer = 0 else: From 1eb1bce583bfcb7259a982c493fde9561c4bfca2 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sat, 9 Mar 2019 20:46:54 -0500 Subject: [PATCH 14/23] Update plugins/PostProcessingPlugin/scripts/ColorMix.py Okay Co-Authored-By: Hrybmo --- plugins/PostProcessingPlugin/scripts/ColorMix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py index 4a2ff718bb..1152ba70da 100644 --- a/plugins/PostProcessingPlugin/scripts/ColorMix.py +++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py @@ -150,7 +150,7 @@ class ColorMix(Script): startLayer = firstHeight endLayer = secondHeight #see if one-shot - if self.getSettingValueByKey("c_behavior") == "fixed_value": + if self.getSettingValueByKey("behavior") == "fixed_value": endLayer = startLayer firstExtruderIncrements = 0 else: #blend From a7c5fe934fb402a9b551bfd5ae630021b6e2059c Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Mon, 11 Mar 2019 08:36:32 +0000 Subject: [PATCH 15/23] Added skin_edge_support_thickness and skin_edge_support_layers. --- resources/definitions/fdmprinter.def.json | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index b4a7788c92..7c89311982 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2031,6 +2031,35 @@ "settable_per_mesh": true } } + }, + "skin_edge_support_thickness": + { + "label": "Skin Edge Support Thickness", + "description": "The thickness of the extra infill that supports skin edges.", + "unit": "mm", + "default_value": 0.8, + "minimum_value": "0", + "maximum_value": "machine_height", + "type": "float", + "value": "resolveOrValue('infill_sparse_thickness') * 4", + "limit_to_extruder": "infill_extruder_nr", + "enabled": "infill_sparse_density > 0", + "settable_per_mesh": true, + "children": + { + "skin_edge_support_layers": + { + "label": "Skin Edge Support Layers", + "description": "The number of infill layers that supports skin edges.", + "default_value": 4, + "minimum_value": "0", + "type": "int", + "value": "0 if infill_sparse_density == 100 else math.ceil(round(skin_edge_support_thickness / resolveOrValue('infill_sparse_thickness'), 4))", + "limit_to_extruder": "infill_extruder_nr", + "enabled": "infill_sparse_density > 0", + "settable_per_mesh": true + } + } } } }, From bc3605dc5890851f09e766949e549aedba0a6155 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Mon, 11 Mar 2019 10:41:36 +0000 Subject: [PATCH 16/23] Now skin_edge_support_thickness defaults to 0 when infill density >= 50%. --- resources/definitions/fdmprinter.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 7c89311982..37ef512f3d 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2041,7 +2041,7 @@ "minimum_value": "0", "maximum_value": "machine_height", "type": "float", - "value": "resolveOrValue('infill_sparse_thickness') * 4", + "value": "resolveOrValue('infill_sparse_thickness') * 4 if infill_sparse_density < 50 else 0", "limit_to_extruder": "infill_extruder_nr", "enabled": "infill_sparse_density > 0", "settable_per_mesh": true, @@ -2054,7 +2054,7 @@ "default_value": 4, "minimum_value": "0", "type": "int", - "value": "0 if infill_sparse_density == 100 else math.ceil(round(skin_edge_support_thickness / resolveOrValue('infill_sparse_thickness'), 4))", + "value": "math.ceil(round(skin_edge_support_thickness / resolveOrValue('infill_sparse_thickness'), 4))", "limit_to_extruder": "infill_extruder_nr", "enabled": "infill_sparse_density > 0", "settable_per_mesh": true From bc924afb641932c4287de63ea301ee0407025507 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Mon, 11 Mar 2019 11:05:20 +0000 Subject: [PATCH 17/23] Default to having 1 skin edge support layer when infill density >= 50. --- 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 37ef512f3d..aa871ed338 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2041,7 +2041,7 @@ "minimum_value": "0", "maximum_value": "machine_height", "type": "float", - "value": "resolveOrValue('infill_sparse_thickness') * 4 if infill_sparse_density < 50 else 0", + "value": "resolveOrValue('infill_sparse_thickness') * (4 if infill_sparse_density < 50 else 1)", "limit_to_extruder": "infill_extruder_nr", "enabled": "infill_sparse_density > 0", "settable_per_mesh": true, From 5919b49646cb495e73a0af2dc09792eff994cd51 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Sun, 17 Mar 2019 13:47:02 +0000 Subject: [PATCH 18/23] Add more possible values for skin_edge_support_thickness. --- 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 aa871ed338..278171827d 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2041,7 +2041,7 @@ "minimum_value": "0", "maximum_value": "machine_height", "type": "float", - "value": "resolveOrValue('infill_sparse_thickness') * (4 if infill_sparse_density < 50 else 1)", + "value": "resolveOrValue('infill_sparse_thickness') * (4 if infill_sparse_density < 12.5 else (3 if infill_sparse_density < 25 else (2 if infill_sparse_density < 50 else 1)))", "limit_to_extruder": "infill_extruder_nr", "enabled": "infill_sparse_density > 0", "settable_per_mesh": true, From 96f8dab853413a526f818aa3bf22d8a509d2c8af Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Thu, 31 Oct 2019 11:43:26 +0100 Subject: [PATCH 19/23] dont prepend 'Pre-sliced file' --- cura/UI/PrintInformation.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cura/UI/PrintInformation.py b/cura/UI/PrintInformation.py index abf1083836..e33ab13b69 100644 --- a/cura/UI/PrintInformation.py +++ b/cura/UI/PrintInformation.py @@ -298,9 +298,7 @@ class PrintInformation(QObject): # Only update the job name when it's not user-specified. if not self._is_user_specified_job_name: - if self._pre_sliced: - self._job_name = catalog.i18nc("@label", "Pre-sliced file {0}", base_name) - elif self._application.getInstance().getPreferences().getValue("cura/jobname_prefix"): + if self._application.getInstance().getPreferences().getValue("cura/jobname_prefix") and not self._pre_sliced: # Don't add abbreviation if it already has the exact same abbreviation. if base_name.startswith(self._abbr_machine + "_"): self._job_name = base_name From 38935a1d020c6915735e2e2b3f749972da08e07c Mon Sep 17 00:00:00 2001 From: Nino van Hooff Date: Tue, 10 Dec 2019 13:53:26 +0100 Subject: [PATCH 20/23] Fix selecting a new material for a base file on container deletion CURA-7023 --- cura/Machines/VariantNode.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cura/Machines/VariantNode.py b/cura/Machines/VariantNode.py index c9e3ec4913..550b5881a3 100644 --- a/cura/Machines/VariantNode.py +++ b/cura/Machines/VariantNode.py @@ -167,15 +167,21 @@ class VariantNode(ContainerNode): # Search for any submaterials from that base file that are still left. materials_same_base_file = ContainerRegistry.getInstance().findContainersMetadata(base_file = base_file) if materials_same_base_file: - most_specific_submaterial = materials_same_base_file[0] + most_specific_submaterial = None for submaterial in materials_same_base_file: if submaterial["definition"] == self.machine.container_id: - if most_specific_submaterial["definition"] == "fdmprinter": + if submaterial.get("variant_name", "empty") == self.variant_name: most_specific_submaterial = submaterial - if most_specific_submaterial.get("variant_name", "empty") == "empty" and submaterial.get("variant_name", "empty") == self.variant_name: + break # most specific match possible + if submaterial.get("variant_name", "empty") == "empty": most_specific_submaterial = submaterial - self.materials[base_file] = MaterialNode(most_specific_submaterial["id"], variant = self) - self.materialsChanged.emit(self.materials[base_file]) + + if most_specific_submaterial is None: + Logger.log("w", "Material %s removed, but no suitable replacement found", base_file) + else: + Logger.log("i", "Material %s (%s) overridden by %s", base_file, self.variant_name, most_specific_submaterial.get("id")) + self.materials[base_file] = MaterialNode(most_specific_submaterial["id"], variant = self) + self.materialsChanged.emit(self.materials[base_file]) if not self.materials: # The last available material just got deleted and there is nothing with the same base file to replace it. self.materials["empty_material"] = MaterialNode("empty_material", variant = self) From 6725e28c07cbd40707c655c710e2ec0b2b160604 Mon Sep 17 00:00:00 2001 From: Nino van Hooff Date: Wed, 11 Dec 2019 11:55:25 +0100 Subject: [PATCH 21/23] Connect materialsChanged signal for printers without variants Fixes duplicated materials not showing up for third party printers CURA-7012 --- cura/Machines/MachineNode.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cura/Machines/MachineNode.py b/cura/Machines/MachineNode.py index 92f71b409b..cee71160d2 100644 --- a/cura/Machines/MachineNode.py +++ b/cura/Machines/MachineNode.py @@ -162,6 +162,7 @@ class MachineNode(ContainerNode): container_registry = ContainerRegistry.getInstance() if not self.has_variants: self.variants["empty"] = VariantNode("empty_variant", machine = self) + self.variants["empty"].materialsChanged.connect(self.materialsChanged) else: # Find all the variants for this definition ID. variants = container_registry.findInstanceContainersMetadata(type = "variant", definition = self.container_id, hardware_type = "nozzle") From 2d486b0814c093b69a3252634fad132b60e80f29 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 11 Dec 2019 17:00:02 +0100 Subject: [PATCH 22/23] Default behaviour should be the same as previous. Also added the new setting to 'expert' visibility. --- resources/definitions/fdmprinter.def.json | 3 ++- resources/setting_visibility/expert.cfg | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index b607c24d70..394342a316 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2083,7 +2083,8 @@ "minimum_value": "0", "maximum_value": "machine_height", "type": "float", - "value": "resolveOrValue('infill_sparse_thickness') * (4 if infill_sparse_density < 12.5 else (3 if infill_sparse_density < 25 else (2 if infill_sparse_density < 50 else 1)))", + "value": "0", + "comment": "This was put at 0 to keep the default behaviour the same, but in the original PR the 'value' was: resolveOrValue('infill_sparse_thickness') * (4 if infill_sparse_density < 12.5 else (3 if infill_sparse_density < 25 else (2 if infill_sparse_density < 50 else 1)))", "limit_to_extruder": "infill_extruder_nr", "enabled": "infill_sparse_density > 0", "settable_per_mesh": true, diff --git a/resources/setting_visibility/expert.cfg b/resources/setting_visibility/expert.cfg index 2b9ad362fc..7b24934b0d 100644 --- a/resources/setting_visibility/expert.cfg +++ b/resources/setting_visibility/expert.cfg @@ -101,6 +101,8 @@ bottom_skin_expand_distance max_skin_angle_for_expansion min_skin_width_for_expansion infill_randomize_start_location +skin_edge_support_thickness +skin_edge_support_layers [material] default_material_print_temperature From e1e65b43b3ce473234ff2f9d93223e6e4718da10 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 12 Dec 2019 14:06:06 +0100 Subject: [PATCH 23/23] Remove gitlab-ci.yml --- .gitlab-ci.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 6c5bc61cbe..0000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,16 +0,0 @@ -image: registry.gitlab.com/ultimaker/cura/cura-build-environment:centos7 - -stages: - - build - -build and test linux: - stage: build - tags: - - cura - - docker - - linux - script: - - docker/build.sh - artifacts: - paths: - - build