From b590e7b86caa7602e0e4bf543444c92a864bfbfc Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 3 May 2017 17:05:56 +0200 Subject: [PATCH 1/7] [WIP] Add place for the extra gradual infill icon CURA-3732 --- resources/qml/SidebarSimple.qml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 86185727b2..eaa303819f 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -30,6 +30,7 @@ Item id: infillCellLeft anchors.top: parent.top anchors.left: parent.left + anchors.topMargin: UM.Theme.getSize("default_margin").height width: base.width * .45 - UM.Theme.getSize("default_margin").width height: childrenRect.height @@ -47,7 +48,7 @@ Item } } - Flow + Row { id: infillCellRight @@ -85,7 +86,7 @@ Item { id: infillIconLining - width: (infillCellRight.width - 3 * UM.Theme.getSize("default_margin").width) / 4; + width: (infillCellRight.width - ((infillModel.count - 1) * UM.Theme.getSize("default_margin").width)) / (infillModel.count); height: width border.color: @@ -181,16 +182,18 @@ Item Component.onCompleted: { infillModel.append({ - name: catalog.i18nc("@label", "Hollow"), + name: catalog.i18nc("@label", "Empty"), percentage: 0, + steps: 0, percentageMin: -1, percentageMax: 0, - text: catalog.i18nc("@label", "No (0%) infill will leave your model hollow at the cost of low strength"), + text: catalog.i18nc("@label", "Empty infill will leave your model hollow with low strength"), icon: "hollow" }) infillModel.append({ name: catalog.i18nc("@label", "Light"), percentage: 20, + steps: 0, percentageMin: 0, percentageMax: 30, text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength"), @@ -199,6 +202,7 @@ Item infillModel.append({ name: catalog.i18nc("@label", "Dense"), percentage: 50, + steps: 0, percentageMin: 30, percentageMax: 70, text: catalog.i18nc("@label", "Dense (50%) infill will give your model an above average strength"), @@ -207,11 +211,20 @@ Item infillModel.append({ name: catalog.i18nc("@label", "Solid"), percentage: 100, + steps: 0, percentageMin: 70, percentageMax: 100, text: catalog.i18nc("@label", "Solid (100%) infill will make your model completely solid"), icon: "solid" }) + infillModel.append({ + name: catalog.i18nc("@label", "Gradual"), + percentage: 90, + steps: 5, + infill_layer_height: 1.5, + text: catalog.i18nc("@label", "This will gradually fill your model towards the top"), + icon: "gradual" + }) } } } @@ -220,7 +233,7 @@ Item { id: helpersCell anchors.top: infillCellRight.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.topMargin: UM.Theme.getSize("default_margin").height * 2 anchors.left: parent.left anchors.right: parent.right height: childrenRect.height @@ -392,7 +405,7 @@ Item property alias _hovered: adhesionMouseArea.containsMouse anchors.top: supportExtruderCombobox.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.topMargin: UM.Theme.getSize("default_margin").height * 2 anchors.left: adhesionHelperLabel.right anchors.leftMargin: UM.Theme.getSize("default_margin").width @@ -467,7 +480,7 @@ Item { id: tipsCell anchors.top: helpersCell.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.topMargin: UM.Theme.getSize("default_margin").height * 2 anchors.left: parent.left width: parent.width height: childrenRect.height @@ -480,7 +493,7 @@ Item anchors.rightMargin: UM.Theme.getSize("default_margin").width wrapMode: Text.WordWrap //: Tips label - text: catalog.i18nc("@label", "Need help improving your prints? Read the Ultimaker Troubleshooting Guides").arg("https://ultimaker.com/en/troubleshooting"); + text: catalog.i18nc("@label", "Need help improving your prints?
Read the Ultimaker Troubleshooting Guides").arg("https://ultimaker.com/en/troubleshooting"); font: UM.Theme.getFont("default"); color: UM.Theme.getColor("text"); linkColor: UM.Theme.getColor("text_link") From 68f5995b19d7f37bc884ca18e37cb95187eba18e Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 3 May 2017 17:05:56 +0200 Subject: [PATCH 2/7] [WIP] Add place for the extra gradual infill icon CURA-3732 --- resources/qml/SidebarSimple.qml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 86185727b2..eaa303819f 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -30,6 +30,7 @@ Item id: infillCellLeft anchors.top: parent.top anchors.left: parent.left + anchors.topMargin: UM.Theme.getSize("default_margin").height width: base.width * .45 - UM.Theme.getSize("default_margin").width height: childrenRect.height @@ -47,7 +48,7 @@ Item } } - Flow + Row { id: infillCellRight @@ -85,7 +86,7 @@ Item { id: infillIconLining - width: (infillCellRight.width - 3 * UM.Theme.getSize("default_margin").width) / 4; + width: (infillCellRight.width - ((infillModel.count - 1) * UM.Theme.getSize("default_margin").width)) / (infillModel.count); height: width border.color: @@ -181,16 +182,18 @@ Item Component.onCompleted: { infillModel.append({ - name: catalog.i18nc("@label", "Hollow"), + name: catalog.i18nc("@label", "Empty"), percentage: 0, + steps: 0, percentageMin: -1, percentageMax: 0, - text: catalog.i18nc("@label", "No (0%) infill will leave your model hollow at the cost of low strength"), + text: catalog.i18nc("@label", "Empty infill will leave your model hollow with low strength"), icon: "hollow" }) infillModel.append({ name: catalog.i18nc("@label", "Light"), percentage: 20, + steps: 0, percentageMin: 0, percentageMax: 30, text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength"), @@ -199,6 +202,7 @@ Item infillModel.append({ name: catalog.i18nc("@label", "Dense"), percentage: 50, + steps: 0, percentageMin: 30, percentageMax: 70, text: catalog.i18nc("@label", "Dense (50%) infill will give your model an above average strength"), @@ -207,11 +211,20 @@ Item infillModel.append({ name: catalog.i18nc("@label", "Solid"), percentage: 100, + steps: 0, percentageMin: 70, percentageMax: 100, text: catalog.i18nc("@label", "Solid (100%) infill will make your model completely solid"), icon: "solid" }) + infillModel.append({ + name: catalog.i18nc("@label", "Gradual"), + percentage: 90, + steps: 5, + infill_layer_height: 1.5, + text: catalog.i18nc("@label", "This will gradually fill your model towards the top"), + icon: "gradual" + }) } } } @@ -220,7 +233,7 @@ Item { id: helpersCell anchors.top: infillCellRight.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.topMargin: UM.Theme.getSize("default_margin").height * 2 anchors.left: parent.left anchors.right: parent.right height: childrenRect.height @@ -392,7 +405,7 @@ Item property alias _hovered: adhesionMouseArea.containsMouse anchors.top: supportExtruderCombobox.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.topMargin: UM.Theme.getSize("default_margin").height * 2 anchors.left: adhesionHelperLabel.right anchors.leftMargin: UM.Theme.getSize("default_margin").width @@ -467,7 +480,7 @@ Item { id: tipsCell anchors.top: helpersCell.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.topMargin: UM.Theme.getSize("default_margin").height * 2 anchors.left: parent.left width: parent.width height: childrenRect.height @@ -480,7 +493,7 @@ Item anchors.rightMargin: UM.Theme.getSize("default_margin").width wrapMode: Text.WordWrap //: Tips label - text: catalog.i18nc("@label", "Need help improving your prints? Read the Ultimaker Troubleshooting Guides").arg("https://ultimaker.com/en/troubleshooting"); + text: catalog.i18nc("@label", "Need help improving your prints?
Read the Ultimaker Troubleshooting Guides").arg("https://ultimaker.com/en/troubleshooting"); font: UM.Theme.getFont("default"); color: UM.Theme.getColor("text"); linkColor: UM.Theme.getColor("text_link") From df0a971326ce8589ce1fdd07f5ace03d68c4f875 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 May 2017 16:59:35 +0200 Subject: [PATCH 3/7] Improve tooltip wording for gradual infill button Contributes to issue CURA-3732. --- resources/qml/SidebarSimple.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index eaa303819f..7dd7c9e25d 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -222,7 +222,7 @@ Item percentage: 90, steps: 5, infill_layer_height: 1.5, - text: catalog.i18nc("@label", "This will gradually fill your model towards the top"), + text: catalog.i18nc("@label", "This will gradually increase the amount of infill towards the top"), icon: "gradual" }) } From ad1b1e04555f9b563968ad866ace615a82c00a27 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 May 2017 17:13:32 +0200 Subject: [PATCH 4/7] Detect whether the current infill is gradual And highlight the correct infill button in that case. Contributes to issue CURA-3732. --- resources/qml/SidebarSimple.qml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 7dd7c9e25d..683b5eb716 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -64,10 +64,11 @@ Item id: infillListView property int activeIndex: { - var density = parseInt(infillDensity.properties.value) + var density = parseInt(infillDensity.properties.value); + var steps = parseInt(infillSteps.properties.value); for(var i = 0; i < infillModel.count; ++i) { - if(density > infillModel.get(i).percentageMin && density <= infillModel.get(i).percentageMax ) + if(density > infillModel.get(i).percentageMin && density <= infillModel.get(i).percentageMax && steps > infillModel.get(i).stepsMin && steps <= infillModel.get(i).stepsMax) { return i; } @@ -187,6 +188,8 @@ Item steps: 0, percentageMin: -1, percentageMax: 0, + stepsMin: -1, + stepsMax: 0, text: catalog.i18nc("@label", "Empty infill will leave your model hollow with low strength"), icon: "hollow" }) @@ -196,6 +199,8 @@ Item steps: 0, percentageMin: 0, percentageMax: 30, + stepsMin: -1, + stepsMax: 0, text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength"), icon: "sparse" }) @@ -205,6 +210,8 @@ Item steps: 0, percentageMin: 30, percentageMax: 70, + stepsMin: -1, + stepsMax: 0, text: catalog.i18nc("@label", "Dense (50%) infill will give your model an above average strength"), icon: "dense" }) @@ -213,7 +220,9 @@ Item percentage: 100, steps: 0, percentageMin: 70, - percentageMax: 100, + percentageMax: 9999999999, + stepsMin: -1, + stepsMax: 0, text: catalog.i18nc("@label", "Solid (100%) infill will make your model completely solid"), icon: "solid" }) @@ -221,6 +230,10 @@ Item name: catalog.i18nc("@label", "Gradual"), percentage: 90, steps: 5, + percentageMin: 0, + percentageMax: 9999999999, + stepsMin: 0, + stepsMax: 9999999999, infill_layer_height: 1.5, text: catalog.i18nc("@label", "This will gradually increase the amount of infill towards the top"), icon: "gradual" @@ -511,6 +524,16 @@ Item storeIndex: 0 } + UM.SettingPropertyProvider + { + id: infillSteps + + containerStackId: Cura.MachineManager.activeStackId + key: "gradual_infill_steps" + watchedProperties: [ "value" ] + storeIndex: 0 + } + UM.SettingPropertyProvider { id: platformAdhesionType From fc1a5e89c3621e98d6267e094d833d95b92c9861 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 May 2017 17:16:18 +0200 Subject: [PATCH 5/7] Change gradual infill upon clicking infill buttons It sets the gradual infill to the value stored in the listmodel. Contributes to issue CURA-3732. --- resources/qml/SidebarSimple.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 683b5eb716..8066e2665a 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -152,6 +152,7 @@ Item if (infillListView.activeIndex != index) { infillDensity.setPropertyValue("value", model.percentage) + infillSteps.setPropertyValue("value", model.steps) } } onEntered: From 6b74b0d49998d8fee7c00f2996b77c4ad4b46f55 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 May 2017 17:25:34 +0200 Subject: [PATCH 6/7] Set default gradual infill step height to 1.5mm All of the profiles currently in Cura that set the gradual infill steps also set the step height (to 3 to 5 layer heights). I'd have chosen 4 layer heights as default based on that, but our material experts say that 1.5mm is about right for most models. Contributes to issue CURA-3732. --- 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 99cfede396..ecebee13fc 100755 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1346,7 +1346,7 @@ "description": "The height of infill of a given density before switching to half the density.", "unit": "mm", "type": "float", - "default_value": 5.0, + "default_value": 1.5, "minimum_value": "0.0001", "minimum_value_warning": "3 * resolveOrValue('layer_height')", "maximum_value_warning": "100", From bcebf4d24c3e78cc79331be548fa6844ff7f8a5e Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 9 May 2017 14:53:26 +0200 Subject: [PATCH 7/7] A gradual infill icon untill we have a better one --- resources/themes/cura/icons/gradual.svg | 102 ++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 resources/themes/cura/icons/gradual.svg diff --git a/resources/themes/cura/icons/gradual.svg b/resources/themes/cura/icons/gradual.svg new file mode 100644 index 0000000000..ed7f301e18 --- /dev/null +++ b/resources/themes/cura/icons/gradual.svg @@ -0,0 +1,102 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + +