From 2caddee2fa9e7e696f77426e4cd1e0842f8bc0e5 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Wed, 28 Dec 2016 08:38:33 +0000 Subject: [PATCH 01/10] Add infill_angles setting to control direction of lines and zig zag infill. This setting provides 4 options: Default - the original directions, 45 and 135. Uniform - one each of 45, 90, 135 and 180. Stronger X - 45, 90, 135 and 90 again - provides more strength in X direction. Stronger Y - 45, 0, 135 and 0 again - provides more strength in Y direction. --- resources/definitions/fdmprinter.def.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 842a2a5bfd..3938ecaaad 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1071,6 +1071,22 @@ "value": "'lines' if infill_sparse_density > 25 else 'grid'", "settable_per_mesh": true }, + "infill_angles": + { + "label": "Infill Line Directions", + "description": "The line directions to use when the infill pattern is lines or zig zag. Default directions are 45 and 135 degrees, Uniform directions are 45, 90, 135 and 180, Stronger X directions are 45, 90, 135 and 90 again and Stronger Y directions are 45, 0, 135 and 0 again.", + "type": "enum", + "options": + { + "45,135": "Default", + "45,90,135,180": "Uniform", + "45,90,135,90": "Stronger X", + "45,0,135,0": "Stronger Y" + }, + "default_value": "45,135", + "enabled": "infill_pattern == 'lines' or infill_pattern == 'zigzag'", + "settable_per_mesh": true + }, "sub_div_rad_mult": { "label": "Cubic Subdivision Radius", From 8d3984a7b48e90eb0d58ea87b500d649322a9bd8 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Thu, 29 Dec 2016 11:32:02 +0000 Subject: [PATCH 02/10] Change Default label to Orthogonal. --- 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 3938ecaaad..f53720d863 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1074,11 +1074,11 @@ "infill_angles": { "label": "Infill Line Directions", - "description": "The line directions to use when the infill pattern is lines or zig zag. Default directions are 45 and 135 degrees, Uniform directions are 45, 90, 135 and 180, Stronger X directions are 45, 90, 135 and 90 again and Stronger Y directions are 45, 0, 135 and 0 again.", + "description": "The line directions to use when the infill pattern is lines or zig zag. Orthogonal directions are 45 and 135 degrees, Uniform directions are 45, 90, 135 and 180, Stronger X directions are 45, 90, 135 and 90 again and Stronger Y directions are 45, 0, 135 and 0 again.", "type": "enum", "options": { - "45,135": "Default", + "45,135": "Orthogonal", "45,90,135,180": "Uniform", "45,90,135,90": "Stronger X", "45,0,135,0": "Stronger Y" From 03fe03ed65eb39ed82448376f3984be3c847dc46 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Mon, 16 Jan 2017 16:05:21 +0000 Subject: [PATCH 03/10] Modify the constraints of the SettingTextField when the setting type is "str". When the setting type is "str" it now allows the setting contents to be up to 20 characters long with no constraint on what those characters are. --- resources/qml/Settings/SettingTextField.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index da24f0f521..af899bec12 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -98,9 +98,9 @@ SettingItem selectByMouse: true; - maximumLength: 10; + maximumLength: (definition.type == "str") ? 20 : 10; - validator: RegExpValidator { regExp: (definition.type == "int") ? /^-?[0-9]{0,10}$/ : /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } // definition.type property from parent loader used to disallow fractional number entry + validator: RegExpValidator { regExp: (definition.type == "str") ? /^.{0,20}$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } // definition.type property from parent loader used to disallow fractional number entry Binding { From efc3869efe4d8cf10488cb385739ca51dc9583ce Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Mon, 16 Jan 2017 16:09:48 +0000 Subject: [PATCH 04/10] Infill Line Directions setting can now contain an arbitrary string. The SettingTextField can now cope with strings of arbitrary characters (not just digits) so revert to plan A and let the user input a comma separated list of angles rather than having fixed combinations. CuraEngine will parse the list and ignore bad input. --- resources/definitions/fdmprinter.def.json | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index dd863719f0..6dd30800be 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1089,15 +1089,8 @@ "infill_angles": { "label": "Infill Line Directions", - "description": "The line directions to use when the infill pattern is lines or zig zag. Orthogonal directions are 45 and 135 degrees, Uniform directions are 45, 90, 135 and 180, Stronger X directions are 45, 90, 135 and 90 again and Stronger Y directions are 45, 0, 135 and 0 again.", - "type": "enum", - "options": - { - "45,135": "Orthogonal", - "45,90,135,180": "Uniform", - "45,90,135,90": "Stronger X", - "45,0,135,0": "Stronger Y" - }, + "description": "A comma separated list of line directions to use when the infill pattern is lines or zig zag. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. Default directions are 45 and 135 degrees.", + "type": "str", "default_value": "45,135", "enabled": "infill_pattern == 'lines' or infill_pattern == 'zigzag'", "settable_per_mesh": true From 3e7b9e99f31d3f96d4b123ca52992814c9fc230e Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Tue, 24 Jan 2017 18:09:11 +0000 Subject: [PATCH 05/10] Now the Infill Line Directions setting is enabled for all infill patterns. The default value is now the empty string which tells the engine to use the traditional angles (45 & 135 for lines and zig zag patterns, just 45 for everything else. --- resources/definitions/fdmprinter.def.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index a85a50b37c..ffabf9a7d5 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1089,10 +1089,9 @@ "infill_angles": { "label": "Infill Line Directions", - "description": "A comma separated list of line directions to use when the infill pattern is lines or zig zag. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. Default directions are 45 and 135 degrees.", + "description": "A comma separated list of line directions to use. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. Default is empty which means use the traditional default angles (45 and 135 degrees for the lines and zig zag patterns and 45 degrees for all other patterns).", "type": "str", - "default_value": "45,135", - "enabled": "infill_pattern == 'lines' or infill_pattern == 'zigzag'", + "default_value": "", "settable_per_mesh": true }, "sub_div_rad_mult": From db3cf0c0fb271461143049285cd7f099d043253f Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Fri, 27 Jan 2017 15:54:19 +0000 Subject: [PATCH 06/10] Add the [int] setting type for settings that are a list of integers. The RegExpValidator (more of a restrictor than a validator) requires the text to start with a '[' and then have a sequence of integers separated by commas. A trailing ']' is accepted. --- cura/CuraApplication.py | 2 ++ plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml | 2 ++ resources/qml/Settings/SettingTextField.qml | 4 ++-- resources/qml/Settings/SettingView.qml | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 6288c2d211..d1f6504431 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -107,6 +107,8 @@ class CuraApplication(QtApplication): SettingDefinition.addSettingType("extruder", None, str, Validator) + SettingDefinition.addSettingType("[int]", None, str, None) + SettingFunction.registerOperator("extruderValues", cura.Settings.ExtruderManager.getExtruderValues) SettingFunction.registerOperator("extruderValue", cura.Settings.ExtruderManager.getExtruderValue) SettingFunction.registerOperator("resolveOrValue", cura.Settings.ExtruderManager.getResolveOrValue) diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 9811316948..cb65da635b 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -209,6 +209,8 @@ Item { { case "int": return settingTextField + case "[int]": + return settingTextField case "float": return settingTextField case "enum": diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index af899bec12..05c99d7e25 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -98,9 +98,9 @@ SettingItem selectByMouse: true; - maximumLength: (definition.type == "str") ? 20 : 10; + maximumLength: (definition.type == "[int]") ? 20 : 10; - validator: RegExpValidator { regExp: (definition.type == "str") ? /^.{0,20}$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } // definition.type property from parent loader used to disallow fractional number entry + validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[(\s*-?[0-9]+\s*,)*(\s*-?[0-9]+)\s*\]$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } // definition.type property from parent loader used to disallow fractional number entry Binding { diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 24022891c3..7138d4acd3 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -217,6 +217,8 @@ Item { case "int": return "SettingTextField.qml" + case "[int]": + return "SettingTextField.qml" case "float": return "SettingTextField.qml" case "enum": From afc75b6c3e5af11636ea9fe64d845f73af713457 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Fri, 27 Jan 2017 15:54:58 +0000 Subject: [PATCH 07/10] Now uses the [int] setting type. The default value is [ ] (an empty list). --- resources/definitions/fdmprinter.def.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index ffabf9a7d5..4f39be7462 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1089,9 +1089,9 @@ "infill_angles": { "label": "Infill Line Directions", - "description": "A comma separated list of line directions to use. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. Default is empty which means use the traditional default angles (45 and 135 degrees for the lines and zig zag patterns and 45 degrees for all other patterns).", - "type": "str", - "default_value": "", + "description": "A list of integer line directions to use. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. The list items are separated by commas and the whole list is contained in square brackets. Default is an empty list which means use the traditional default angles (45 and 135 degrees for the lines and zig zag patterns and 45 degrees for all other patterns).", + "type": "[int]", + "default_value": "[ ]", "settable_per_mesh": true }, "sub_div_rad_mult": From 27a52092d301121e439097777614529ba28a4dcd Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Fri, 27 Jan 2017 15:55:22 +0000 Subject: [PATCH 08/10] Add the skin_angles setting which is analogous to the infill_angles setting. --- resources/definitions/fdmprinter.def.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 4f39be7462..adf909a644 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -905,6 +905,14 @@ "value": "top_bottom_pattern", "settable_per_mesh": true }, + "skin_angles": + { + "label": "Top/Bottom Line Directions", + "description": "A list of integer line directions to use when the top/bottom layers use the lines or zig zag pattern. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. The list items are separated by commas and the whole list is contained in square brackets. Default is an empty list which means use the traditional default angles (45 and 135 degrees).", + "type": "[int]", + "default_value": "[ ]", + "settable_per_mesh": true + }, "wall_0_inset": { "label": "Outer Wall Inset", From d6bed392e4d3f6acc408f64cf75a3f90e4086e11 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Thu, 2 Mar 2017 07:46:55 +0000 Subject: [PATCH 09/10] Disable skin_angles setting when top_bottom_pattern is concentric. --- resources/definitions/fdmprinter.def.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index a802ea1ca6..133c0b0dfb 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -914,6 +914,7 @@ "description": "A list of integer line directions to use when the top/bottom layers use the lines or zig zag pattern. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. The list items are separated by commas and the whole list is contained in square brackets. Default is an empty list which means use the traditional default angles (45 and 135 degrees).", "type": "[int]", "default_value": "[ ]", + "enabled": "top_bottom_pattern != 'concentric'", "settable_per_mesh": true }, "wall_0_inset": From aef39991a2e78c4f05731be0eb618349593a1871 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Thu, 2 Mar 2017 07:47:41 +0000 Subject: [PATCH 10/10] Disable infill_angles setting when infill_pattern is concentric, concentric_3d or cubicsubdiv. --- resources/definitions/fdmprinter.def.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 133c0b0dfb..a79ac58547 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1104,6 +1104,7 @@ "description": "A list of integer line directions to use. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. The list items are separated by commas and the whole list is contained in square brackets. Default is an empty list which means use the traditional default angles (45 and 135 degrees for the lines and zig zag patterns and 45 degrees for all other patterns).", "type": "[int]", "default_value": "[ ]", + "enabled": "infill_pattern != 'concentric' and infill_pattern != 'concentric_3d' and infill_pattern != 'cubicsubdiv'", "settable_per_mesh": true }, "sub_div_rad_mult":