From 799d1a5b0cf0634cfa1bdccb3fcd830cec737c58 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 11 Oct 2017 21:02:27 +0200 Subject: [PATCH 01/49] Updated setting items & sidebar to qtQuick controls 2.0 --- resources/qml/Settings/SettingCategory.qml | 169 +++++++++++++++++- resources/qml/Settings/SettingCheckBox.qml | 3 +- resources/qml/Settings/SettingComboBox.qml | 93 ++++------ resources/qml/Settings/SettingExtruder.qml | 124 ++++++------- resources/qml/Settings/SettingItem.qml | 3 +- .../qml/Settings/SettingOptionalExtruder.qml | 126 +++++++------ resources/qml/Settings/SettingTextField.qml | 2 +- resources/qml/Settings/SettingUnknown.qml | 2 +- resources/qml/Sidebar.qml | 74 ++------ 9 files changed, 342 insertions(+), 254 deletions(-) diff --git a/resources/qml/Settings/SettingCategory.qml b/resources/qml/Settings/SettingCategory.qml index 53f8f89e15..650ffdc4c6 100644 --- a/resources/qml/Settings/SettingCategory.qml +++ b/resources/qml/Settings/SettingCategory.qml @@ -2,17 +2,57 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 -import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 import UM 1.1 as UM import Cura 1.0 as Cura -Button { +Button +{ id: base; - - style: UM.Theme.styles.sidebar_category; + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width + anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width + background: Rectangle + { + implicitHeight: UM.Theme.getSize("section").height; + color: { + if(base.color) { + return base.color; + } else if(!base.enabled) { + return UM.Theme.getColor("setting_category_disabled"); + } else if(base.hovered && base.checkable && base.checked) { + return UM.Theme.getColor("setting_category_active_hover"); + } else if(base.pressed || (base.checkable && base.checked)) { + return UM.Theme.getColor("setting_category_active"); + } else if(base.hovered) { + return UM.Theme.getColor("setting_category_hover"); + } else { + return UM.Theme.getColor("setting_category"); + } + } + Behavior on color { ColorAnimation { duration: 50; } } + Rectangle + { + height: UM.Theme.getSize("default_lining").height + width: parent.width + anchors.bottom: parent.bottom + color: { + if(!base.enabled) { + return UM.Theme.getColor("setting_category_disabled_border"); + } else if((base.hovered || base.activeFocus) && base.checkable && base.checked) { + return UM.Theme.getColor("setting_category_active_hover_border"); + } else if(base.pressed || (base.checkable && base.checked)) { + return UM.Theme.getColor("setting_category_active_border"); + } else if(base.hovered || base.activeFocus) { + return UM.Theme.getColor("setting_category_hover_border"); + } else { + return UM.Theme.getColor("setting_category_border"); + } + } + } + } signal showTooltip(string text) signal hideTooltip() @@ -23,8 +63,121 @@ Button { property var focusItem: base - text: definition.label - iconSource: UM.Theme.getIcon(definition.icon) + //text: definition.label + + contentItem: Item { + anchors.fill: parent; + anchors.left: parent.left + + Label { + anchors + { + left: parent.left + leftMargin: 2 * UM.Theme.getSize("default_margin").width + UM.Theme.getSize("section_icon").width + right: parent.right; + verticalCenter: parent.verticalCenter; + } + text: definition.label + font: UM.Theme.getFont("setting_category"); + color: + { + if(!base.enabled) + { + return UM.Theme.getColor("setting_category_disabled_text"); + } + else if((base.hovered || base.activeFocus) && base.checkable && base.checked) + { + return UM.Theme.getColor("setting_category_active_hover_text"); + } + else if(base.pressed || (base.checkable && base.checked)) + { + return UM.Theme.getColor("setting_category_active_text"); + } + else if(base.hovered || base.activeFocus) + { + return UM.Theme.getColor("setting_category_hover_text"); + } + else + { + return UM.Theme.getColor("setting_category_text"); + } + } + fontSizeMode: Text.HorizontalFit; + minimumPointSize: 8 + } + UM.RecolorImage + { + id: category_arrow + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_margin").width * 3 - width / 2 + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + sourceSize.height: width + color: + { + if(!base.enabled) + { + return UM.Theme.getColor("setting_category_disabled_text"); + } + else if((base.hovered || base.activeFocus) && base.checkable && base.checked) + { + return UM.Theme.getColor("setting_category_active_hover_text"); + } + else if(base.pressed || (base.checkable && base.checked)) + { + return UM.Theme.getColor("setting_category_active_text"); + } + else if(base.hovered || base.activeFocus) + { + return UM.Theme.getColor("setting_category_hover_text"); + } + else + { + return UM.Theme.getColor("setting_category_text"); + } + } + source: base.checked ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") + } + } + + UM.RecolorImage + { + id: icon + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + color: + { + if(!base.enabled) + { + return UM.Theme.getColor("setting_category_disabled_text"); + } + else if((base.hovered || base.activeFocus) && base.checkable && base.checked) + { + return UM.Theme.getColor("setting_category_active_hover_text"); + } + else if(base.pressed || (base.checkable && base.checked)) + { + return UM.Theme.getColor("setting_category_active_text"); + } + else if(base.hovered || base.activeFocus) + { + return UM.Theme.getColor("setting_category_hover_text"); + } + else + { + return UM.Theme.getColor("setting_category_text"); + } + } + source: UM.Theme.getIcon(definition.icon) + width: UM.Theme.getSize("section_icon").width; + height: UM.Theme.getSize("section_icon").height; + sourceSize.width: width + 15 * screenScaleFactor + sourceSize.height: width + 15 * screenScaleFactor + } + checkable: true checked: definition.expanded diff --git a/resources/qml/Settings/SettingCheckBox.qml b/resources/qml/Settings/SettingCheckBox.qml index 9029249249..651ee91366 100644 --- a/resources/qml/Settings/SettingCheckBox.qml +++ b/resources/qml/Settings/SettingCheckBox.qml @@ -3,8 +3,7 @@ import QtQuick 2.1 import QtQuick.Layouts 1.1 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.0 import UM 1.2 as UM diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index f2ec5fda65..eaa22e1a9f 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -2,8 +2,7 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.0 import UM 1.1 as UM @@ -28,73 +27,59 @@ SettingItem onWheel: wheel.accepted = true; } - style: ComboBoxStyle + background: Rectangle { - background: Rectangle + color: { - color: + if(!enabled) { - if(!enabled) - { - return UM.Theme.getColor("setting_control_disabled") - } - if(control.hovered || control.activeFocus) - { - return UM.Theme.getColor("setting_control_highlight") - } - return UM.Theme.getColor("setting_control") + return UM.Theme.getColor("setting_control_disabled") } - border.width: UM.Theme.getSize("default_lining").width - border.color: + if(control.hovered || control.activeFocus) { - if(!enabled) - { - return UM.Theme.getColor("setting_control_disabled_border") - } - if(control.hovered || control.activeFocus) - { - return UM.Theme.getColor("setting_control_border_highlight") - } - return UM.Theme.getColor("setting_control_border") + return UM.Theme.getColor("setting_control_highlight") } + return UM.Theme.getColor("setting_control") } - label: Item + border.width: UM.Theme.getSize("default_lining").width + border.color: { - Label + if(!enabled) { - anchors.left: parent.left; - anchors.leftMargin: UM.Theme.getSize("default_lining").width - anchors.right: downArrow.left; - anchors.rightMargin: UM.Theme.getSize("default_lining").width; - anchors.verticalCenter: parent.verticalCenter; - - text: control.currentText; - font: UM.Theme.getFont("default"); - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); - - elide: Text.ElideRight; - verticalAlignment: Text.AlignVCenter; + return UM.Theme.getColor("setting_control_disabled_border") } - - UM.RecolorImage + if(control.hovered || control.activeFocus) { - id: downArrow - anchors.right: parent.right; - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2; - anchors.verticalCenter: parent.verticalCenter; - - source: UM.Theme.getIcon("arrow_bottom") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor - - color: UM.Theme.getColor("setting_control_text"); - + return UM.Theme.getColor("setting_control_border_highlight") } + return UM.Theme.getColor("setting_control_border") } } + indicator: UM.RecolorImage + { + id: downArrow + x: control.width - width - control.rightPadding + y: control.topPadding + (control.availableHeight - height) / 2 + + source: UM.Theme.getIcon("arrow_bottom") + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + 5 * screenScaleFactor + sourceSize.height: width + 5 * screenScaleFactor + + color: UM.Theme.getColor("setting_control_text"); + } + + contentItem: Label + { + text: control.currentText; + font: UM.Theme.getFont("default"); + color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); + elide: Text.ElideRight; + verticalAlignment: Text.AlignVCenter; + } + onActivated: { forceActiveFocus(); diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index ca99640f6d..0568343b8c 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -2,8 +2,7 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.0 import UM 1.1 as UM import Cura 1.0 as Cura @@ -65,83 +64,78 @@ SettingItem value: control.currentText != "" ? control.model.getItem(control.currentIndex).color : "" } - style: ComboBoxStyle + indicator: UM.RecolorImage { - background: Rectangle + id: downArrow + x: control.width - width - control.rightPadding + y: control.topPadding + (control.availableHeight - height) / 2 + + source: UM.Theme.getIcon("arrow_bottom") + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + 5 * screenScaleFactor + sourceSize.height: width + 5 * screenScaleFactor + + color: UM.Theme.getColor("setting_control_text"); + } + + background: Rectangle + { + color: { - color: + if(!enabled) { - if(!enabled) - { - return UM.Theme.getColor("setting_control_disabled"); - } - if(control.hovered || base.activeFocus) - { - return UM.Theme.getColor("setting_control_highlight"); - } - return UM.Theme.getColor("setting_control"); + return UM.Theme.getColor("setting_control_disabled"); } - border.width: UM.Theme.getSize("default_lining").width - border.color: + if(control.hovered || base.activeFocus) { - if(!enabled) - { - return UM.Theme.getColor("setting_control_disabled_border") - } - if(control.hovered || control.activeFocus) - { - return UM.Theme.getColor("setting_control_border_highlight") - } - return UM.Theme.getColor("setting_control_border") + return UM.Theme.getColor("setting_control_highlight"); } + return UM.Theme.getColor("setting_control"); } - label: Item + border.width: UM.Theme.getSize("default_lining").width + border.color: { - Label + if(!enabled) { - id: extruderText - anchors.verticalCenter: parent.verticalCenter - - text: control.currentText - font: UM.Theme.getFont("default") - color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - - elide: Text.ElideLeft - verticalAlignment: Text.AlignVCenter + return UM.Theme.getColor("setting_control_disabled_border") } - Rectangle + if(control.hovered || control.activeFocus) { - id: swatch - height: UM.Theme.getSize("setting_control").height / 2 - width: height - - anchors - { - right: arrow.left - verticalCenter: parent.verticalCenter - margins: UM.Theme.getSize("default_margin").width / 4 - } - - border.width: UM.Theme.getSize("default_lining").width * 2 - border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") - radius: width / 2 - - color: control.color + return UM.Theme.getColor("setting_control_border_highlight") } - UM.RecolorImage - { - id: arrow - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter + return UM.Theme.getColor("setting_control_border") + } + } + contentItem: Item + { + Label + { + id: extruderText + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.right: swatch.left + text: control.currentText + font: UM.Theme.getFont("default") + color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - source: UM.Theme.getIcon("arrow_bottom") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor + elide: Text.ElideLeft + verticalAlignment: Text.AlignVCenter + } + Rectangle + { + id: swatch + height: UM.Theme.getSize("setting_control").height / 2 + width: height - color: UM.Theme.getColor("setting_control_text") - } + anchors.right: parent.right + anchors.rightMargin: control.indicator.width + control.spacing + + border.width: UM.Theme.getSize("default_lining").width * 2 + border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") + radius: width / 2 + + color: control.color } } } diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index 2bf2c17273..ff978e0d6f 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -3,8 +3,7 @@ import QtQuick 2.1 import QtQuick.Layouts 1.1 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.0 import UM 1.1 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 1c286fcd2d..43588edfce 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -2,8 +2,7 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.0 import UM 1.1 as UM import Cura 1.0 as Cura @@ -84,83 +83,80 @@ SettingItem value: control.currentText != "" ? control.model.getItem(control.currentIndex).color : "" } - style: ComboBoxStyle + indicator: UM.RecolorImage { - background: Rectangle + id: downArrow + x: control.width - width - control.rightPadding + y: control.topPadding + (control.availableHeight - height) / 2 + + source: UM.Theme.getIcon("arrow_bottom") + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + 5 * screenScaleFactor + sourceSize.height: width + 5 * screenScaleFactor + + color: UM.Theme.getColor("setting_control_text"); + } + + background: Rectangle + { + color: { - color: + if(!enabled) { - if(!enabled) - { - return UM.Theme.getColor("setting_control_disabled"); - } - if(control.hovered || control.activeFocus) - { - return UM.Theme.getColor("setting_control_highlight"); - } - return UM.Theme.getColor("setting_control"); + return UM.Theme.getColor("setting_control_disabled"); } - border.width: UM.Theme.getSize("default_lining").width - border.color: + if(control.hovered || control.activeFocus) { - if(!enabled) - { - return UM.Theme.getColor("setting_control_disabled_border") - } - if(control.hovered || control.activeFocus) - { - return UM.Theme.getColor("setting_control_border_highlight") - } - return UM.Theme.getColor("setting_control_border") + return UM.Theme.getColor("setting_control_highlight"); } + return UM.Theme.getColor("setting_control"); } - label: Item + border.width: UM.Theme.getSize("default_lining").width + border.color: { - Label + if(!enabled) { - anchors.verticalCenter: parent.verticalCenter - width: parent.width - swatch.width - arrow.width; - - text: control.currentText - font: UM.Theme.getFont("default") - color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter + return UM.Theme.getColor("setting_control_disabled_border") } - Rectangle + if(control.hovered || control.activeFocus) { - id: swatch - height: UM.Theme.getSize("setting_control").height / 2 - width: height - - anchors - { - right: arrow.left; - verticalCenter: parent.verticalCenter - margins: UM.Theme.getSize("default_margin").width / 4 - } - - border.width: UM.Theme.getSize("default_lining").width * 2 - border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") - radius: width / 2 - - color: control.color + return UM.Theme.getColor("setting_control_border_highlight") } - UM.RecolorImage - { - id: arrow - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter + return UM.Theme.getColor("setting_control_border") + } + } - source: UM.Theme.getIcon("arrow_bottom") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor + contentItem: Item + { + Label + { + id: extruderText + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.right: swatch.left - color: UM.Theme.getColor("setting_control_text") - } + text: control.currentText + font: UM.Theme.getFont("default") + color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") + + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + } + Rectangle + { + id: swatch + height: UM.Theme.getSize("setting_control").height / 2 + width: height + + anchors.right: parent.right + anchors.rightMargin: control.indicator.width + control.spacing + + border.width: UM.Theme.getSize("default_lining").width * 2 + border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") + radius: width / 2 + + color: control.color } } } diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index ffc169af1a..5259df5876 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -2,7 +2,7 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.2 +import QtQuick.Controls 2.0 import UM 1.1 as UM diff --git a/resources/qml/Settings/SettingUnknown.qml b/resources/qml/Settings/SettingUnknown.qml index f4dadf8d75..bca786dc0d 100644 --- a/resources/qml/Settings/SettingUnknown.qml +++ b/resources/qml/Settings/SettingUnknown.qml @@ -2,7 +2,7 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.0 import UM 1.2 as UM diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index a82651defe..bc8c1834d8 100755 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -2,8 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.0 import QtQuick.Layouts 1.1 import UM 1.2 as UM @@ -110,7 +109,7 @@ Rectangle UM.Preferences.setValue("cura/active_mode", currentModeIndex); if(modesListModel.count > base.currentModeIndex) { - sidebarContents.push({ "item": modesListModel.get(base.currentModeIndex).item, "replace": true }); + sidebarContents.push(modesListModel.get(base.currentModeIndex).item, {"replace": true }); } } @@ -156,7 +155,7 @@ Rectangle anchors.verticalCenter: parent.verticalCenter width: Math.floor(0.5 * parent.width) text: model.text - exclusiveGroup: modeMenuGroup; + ButtonGroup.group: modeMenuGroup; checkable: true; checked: base.currentModeIndex == index onClicked: base.currentModeIndex = index @@ -175,36 +174,9 @@ Rectangle } } - style: ButtonStyle { - background: Rectangle { - border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width - border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") : - control.hovered ? UM.Theme.getColor("action_button_hovered_border") : - UM.Theme.getColor("action_button_border") - color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : - control.hovered ? UM.Theme.getColor("action_button_hovered") : - UM.Theme.getColor("action_button") - Behavior on color { ColorAnimation { duration: 50; } } - Label { - anchors.left: parent.left - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: UM.Theme.getSize("default_lining").width * 2 - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 - color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_text") : - control.hovered ? UM.Theme.getColor("action_button_hovered_text") : - UM.Theme.getColor("action_button_text") - font: UM.Theme.getFont("default") - text: control.text - horizontalAlignment: Text.AlignHCenter - elide: Text.ElideMiddle - } - } - label: Item { } - } } } - ExclusiveGroup { id: modeMenuGroup; } + ButtonGroup { id: modeMenuGroup; } ListView { @@ -229,31 +201,21 @@ Rectangle anchors.right: base.right visible: !monitoringPrint && !hideSettings - delegate: StackViewDelegate - { - function transitionFinished(properties) - { - properties.exitItem.opacity = 1 + pushEnter:Transition { + PropertyAnimation { + property: "opacity" + from: 0 + to:1 + duration: 100 } + } - pushTransition: StackViewTransition - { - PropertyAnimation - { - target: enterItem - property: "opacity" - from: 0 - to: 1 - duration: 100 - } - PropertyAnimation - { - target: exitItem - property: "opacity" - from: 1 - to: 0 - duration: 100 - } + pushExit: Transition { + PropertyAnimation { + property: "opacity" + from: 1 + to:0 + duration: 100 } } } @@ -488,7 +450,7 @@ Rectangle tooltipText: catalog.i18nc("@tooltip", "Custom Print Setup

Print with finegrained control over every last bit of the slicing process."), item: sidebarAdvanced }) - sidebarContents.push({ "item": modesListModel.get(base.currentModeIndex).item, "immediate": true }); + sidebarContents.push( modesListModel.get(base.currentModeIndex).item, {"immediate": true }); var index = Math.floor(UM.Preferences.getValue("cura/active_mode")) if(index) From 1491c37485c49750c0f13dade58343406b0e1d7c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 3 Nov 2017 16:03:28 +0100 Subject: [PATCH 02/49] Don't crash if support density is 0 Found while working on CURA-4523. --- 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 cffaa1df3d..459d1911b1 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3495,7 +3495,7 @@ "minimum_value_warning": "support_line_width", "default_value": 2.66, "enabled": "support_enable", - "value": "(support_line_width * 100) / support_infill_rate * (2 if support_pattern == 'grid' else (3 if support_pattern == 'triangles' else 1))", + "value": "0 if support_infill_rate == 0 else (support_line_width * 100) / support_infill_rate * (2 if support_pattern == 'grid' else (3 if support_pattern == 'triangles' else 1))", "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false, "settable_per_extruder": true @@ -5127,7 +5127,7 @@ "description": "Skip one in every N connection lines to make the support structure easier to break away.", "type": "int", "default_value": 5, - "value": "round(support_skip_zag_per_mm / support_line_distance)", + "value": "0 if support_line_distance == 0 else round(support_skip_zag_per_mm / support_line_distance)", "minimum_value": "1", "minimum_value_warning": "3", "enabled": "support_enable and (support_pattern == 'zigzag') and support_skip_some_zags", From f89c494274adf473fb699906f43b87411f7f4f0c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 3 Nov 2017 09:24:46 +0100 Subject: [PATCH 03/49] Add settings for tree support These three to start with. I don't know if I can implement more. We'll see about that later. Contributes to issue CURA-4523. --- resources/definitions/fdmprinter.def.json | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 459d1911b1..815fed7390 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3655,6 +3655,44 @@ "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false }, + "support_tree_enable": + { + "label": "Tree Support", + "description": "Generate a tree-like support with branches that support your print. This may reduce material usage and print time.", + "type": "bool", + "default_value": false, + "settable_per_mesh": true + }, + "support_tree_angle": + { + "label": "Tree Support Branch Angle", + "description": "The angle of the branches. Use a lower angle to make them more vertical and more stable. Use a higher angle to be able to have more reach.", + "unit": "°", + "type": "float", + "minimum_value": "0", + "maximum_value": "90", + "maximum_value_warning": "60", + "default_value": 40, + "limit_to_extruder": "support_infill_extruder_nr", + "enabled": "support_tree_enable", + "settable_per_mesh": false, + "settable_per_extruder": true + }, + "support_tree_wall_thickness": + { + "label": "Tree Support Wall Thickness", + "description": "The thickness of the walls of the tree support. Thicker walls take longer to print but are more stable.", + "unit": "mm", + "type": "float", + "minimum_value": "0", + "minimum_value_warning": "wall_line_width", + "default_value": 0.8, + "value": "wall_line_width * 2", + "limit_to_extruder": "support_infill_extruder_nr", + "enabled": "support_tree_enable", + "settable_per_mesh": false, + "settable_per_extruder": true + }, "gradual_support_infill_steps": { "label": "Gradual Support Infill Steps", From 72c32bac3a16182ed99a7a89cad7d90f1fdb2cb0 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 3 Nov 2017 10:55:23 +0100 Subject: [PATCH 04/49] Add tree support wall line count setting I knew I forgot one. Contributes to issue CURA-4523. --- resources/definitions/fdmprinter.def.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 815fed7390..c2a069aa6e 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3681,7 +3681,7 @@ "support_tree_wall_thickness": { "label": "Tree Support Wall Thickness", - "description": "The thickness of the walls of the tree support. Thicker walls take longer to print but are more stable.", + "description": "The thickness of the walls of the branches of tree support. Thicker walls take longer to print but don't fall over as easily.", "unit": "mm", "type": "float", "minimum_value": "0", @@ -3691,7 +3691,24 @@ "limit_to_extruder": "support_infill_extruder_nr", "enabled": "support_tree_enable", "settable_per_mesh": false, - "settable_per_extruder": true + "settable_per_extruder": true, + "children": + { + "support_tree_wall_line_count": + { + "label": "Tree Support Wall Line Count", + "description": "The number of walls of the branches of tree support. Thicker walls take longer to print but don't fall over as easily.", + "type": "int", + "minimum_value": "0", + "minimum_value_warning": "1", + "default_value": 2, + "value": "round(support_tree_wall_thickness / support_line_width)", + "limit_to_extruder": "support_infill_extruder_nr", + "enabled": "support_tree_enable", + "settable_per_mesh": false, + "settable_per_extruder": true + } + } }, "gradual_support_infill_steps": { From 79dee2619e8bc36d961781a42789af85d090cd53 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Nov 2017 15:27:43 +0100 Subject: [PATCH 05/49] Also show some of the support settings for support trees Only the ones that are applicable to support trees as well (such as the overhang angle). I haven't decided on whether support interfaces should be implemented. Maybe later. Contributes to issue CURA-4523. --- resources/definitions/fdmprinter.def.json | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index c2a069aa6e..f57273e280 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3344,7 +3344,7 @@ "description": "The extruder train to use for printing the support. This is used in multi-extrusion.", "type": "extruder", "default_value": "0", - "enabled": "support_enable and machine_extruder_count > 1", + "enabled": "(support_enable or support_tree_enable) and machine_extruder_count > 1", "settable_per_mesh": false, "settable_per_extruder": false, "children": { @@ -3355,7 +3355,7 @@ "type": "extruder", "default_value": "0", "value": "support_extruder_nr", - "enabled": "support_enable and machine_extruder_count > 1", + "enabled": "(support_enable or support_tree_enable) and machine_extruder_count > 1", "settable_per_mesh": false, "settable_per_extruder": false }, @@ -3366,7 +3366,7 @@ "type": "extruder", "default_value": "0", "value": "support_extruder_nr", - "enabled": "support_enable and machine_extruder_count > 1", + "enabled": "(support_enable or support_tree_enable) and machine_extruder_count > 1", "settable_per_mesh": false, "settable_per_extruder": false }, @@ -3420,7 +3420,7 @@ }, "default_value": "everywhere", "resolve": "'everywhere' if 'everywhere' in extruderValues('support_type') else 'buildplate'", - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "settable_per_mesh": false, "settable_per_extruder": false }, @@ -3435,7 +3435,7 @@ "maximum_value_warning": "80", "default_value": 50, "limit_to_extruder": "support_roof_extruder_nr if support_roof_enable else support_infill_extruder_nr", - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "settable_per_mesh": true }, "support_pattern": @@ -3512,7 +3512,7 @@ "maximum_value_warning": "machine_nozzle_size", "default_value": 0.1, "limit_to_extruder": "support_interface_extruder_nr if support_interface_enable else support_infill_extruder_nr", - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "settable_per_mesh": true, "children": { @@ -3525,7 +3525,7 @@ "maximum_value_warning": "machine_nozzle_size", "default_value": 0.1, "type": "float", - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "value": "extruderValue(support_roof_extruder_nr if support_roof_enable else support_infill_extruder_nr, 'support_z_distance')", "limit_to_extruder": "support_roof_extruder_nr if support_roof_enable else support_infill_extruder_nr", "settable_per_mesh": true @@ -3541,7 +3541,7 @@ "value": "extruderValue(support_bottom_extruder_nr if support_bottom_enable else support_infill_extruder_nr, 'support_z_distance') if support_type == 'everywhere' else 0", "limit_to_extruder": "support_bottom_extruder_nr if support_bottom_enable else support_infill_extruder_nr", "type": "float", - "enabled": "support_enable and resolveOrValue('support_type') == 'everywhere'", + "enabled": "(support_enable or support_tree_enable) and resolveOrValue('support_type') == 'everywhere'", "settable_per_mesh": true } } @@ -3556,7 +3556,7 @@ "maximum_value_warning": "1.5 * machine_nozzle_tip_outer_diameter", "default_value": 0.7, "limit_to_extruder": "support_infill_extruder_nr", - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "settable_per_mesh": true }, "support_xy_overrides_z": @@ -3571,7 +3571,7 @@ }, "default_value": "z_overrides_xy", "limit_to_extruder": "support_infill_extruder_nr", - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "settable_per_mesh": true }, "support_xy_distance_overhang": @@ -3585,7 +3585,7 @@ "default_value": 0.2, "value": "machine_nozzle_size / 2", "limit_to_extruder": "support_infill_extruder_nr", - "enabled": "support_enable and support_xy_overrides_z == 'z_overrides_xy'", + "enabled": "(support_enable or support_tree_enable) and support_xy_overrides_z == 'z_overrides_xy'", "settable_per_mesh": true }, "support_bottom_stair_step_height": @@ -3651,7 +3651,7 @@ "maximum_value_warning": "0.75 * machine_nozzle_size", "maximum_value": "resolveOrValue('layer_height') * 8", "value": "resolveOrValue('layer_height')", - "enabled": "support_enable and support_infill_rate > 0", + "enabled": "(support_enable or support_tree_enable) and support_infill_rate > 0", "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false }, @@ -4036,7 +4036,7 @@ "description": "Remove empty layers beneath the first printed layer if they are present. Disabling this setting can cause empty first layers if the Slicing Tolerance setting is set to Exclusive or Middle.", "type": "bool", "default_value": true, - "enabled": "not support_enable", + "enabled": "not support_enable and not support_tree_enable", "settable_per_mesh": false, "settable_per_extruder": false } From 2ce7c919119e91e5629eb751e277ab7572a2ec0a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Nov 2017 17:30:07 +0100 Subject: [PATCH 06/49] Add setting for contact point spread I'm not sure what will come of this later, but for now I need it. Contributes to issue CURA-4523. --- resources/definitions/fdmprinter.def.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index f57273e280..8c311a9f2f 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3678,6 +3678,18 @@ "settable_per_mesh": false, "settable_per_extruder": true }, + "support_tree_branch_distance": + { + "label": "Tree Support Branch Distance", + "description": "How far apart the branches need to be when they touch the model. Making this distance small will cause the tree support to touch the model at more points, causing better overhang but making support harder to remove.", + "unit": "mm", + "type": "float", + "minimum_value": "0.001", + "default_value": 4, + "limit_to_extruder": "support_infill_extruder_nr", + "enabled": "support_tree_enable", + "settable_per_mesh": true + }, "support_tree_wall_thickness": { "label": "Tree Support Wall Thickness", From 380b0ed2e7154fbd581296ef02cc3bdea2f02695 Mon Sep 17 00:00:00 2001 From: Ruben D Date: Wed, 8 Nov 2017 20:11:49 +0100 Subject: [PATCH 07/49] Add setting for branch diameter Contributes to issue CURA-4523. --- resources/definitions/fdmprinter.def.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 8c311a9f2f..176c41dce7 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3690,6 +3690,20 @@ "enabled": "support_tree_enable", "settable_per_mesh": true }, + "support_tree_branch_diameter": + { + "label": "Tree Support Branch Diameter", + "description": "The diameter of the thinnest branches of tree support. Thicker branches are more sturdy. Branches towards the base will be thicker than this.", + "unit": "mm", + "type": "float", + "minimum_value": "0.001", + "minimum_value_warning": "support_line_width * 2", + "default_value": 2, + "limit_to_extruder": "support_infill_extruder_nr", + "enabled": "support_tree_enable", + "settable_per_mesh": false, + "settable_per_extruder": true + }, "support_tree_wall_thickness": { "label": "Tree Support Wall Thickness", From b660b2ca862f5084837834f771f0e99f1b8d5c91 Mon Sep 17 00:00:00 2001 From: Ruben D Date: Thu, 9 Nov 2017 00:47:20 +0100 Subject: [PATCH 08/49] Rename support_tree_wall_line_count to support_tree_wall_count Wall line is double. Just name it wall. Contributes to issue CURA-4523. --- 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 176c41dce7..14d7e7f39e 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3720,7 +3720,7 @@ "settable_per_extruder": true, "children": { - "support_tree_wall_line_count": + "support_tree_wall_count": { "label": "Tree Support Wall Line Count", "description": "The number of walls of the branches of tree support. Thicker walls take longer to print but don't fall over as easily.", From cd6b1aca2956d40eb505780293bb22930b6a595f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 10 Nov 2017 13:05:32 +0100 Subject: [PATCH 09/49] Add branch diameter angle setting It's a bit obscure. Could we devise a better setting name? Contributes to issue CURA-4523. --- 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 14d7e7f39e..c9dae14bd4 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3704,6 +3704,22 @@ "settable_per_mesh": false, "settable_per_extruder": true }, + "support_tree_branch_diameter_angle": + { + "label": "Tree Support Branch Diameter Angle", + "description": "The angle of the branches' diameter as they gradually become thicker towards the bottom. An angle of 0 will cause the branches to have uniform thickness over their length. A negative angle makes them thinner towards the bottom, so be careful as they might disappear. A small positive angle can increase stability of the tree support.", + "unit": "°", + "type": "float", + "minimum_value": "-89.9999", + "maximum_value": "89.9999", + "minimum_value_warning": "0", + "maximum_value_warning": "15", + "default_value": 5, + "limit_to_extruder": "support_infill_extruder_nr", + "enabled": "support_tree_enable", + "settable_per_mesh": false, + "settable_per_extruder": true + }, "support_tree_wall_thickness": { "label": "Tree Support Wall Thickness", From 4cc895b54b7c242aac4ea08f57dd1b4749ae7e36 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 10 Nov 2017 13:06:29 +0100 Subject: [PATCH 10/49] Use 1 wall for tree support by default Contributes to issue CURA-4523. --- 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 c9dae14bd4..b127b614af 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3729,7 +3729,7 @@ "minimum_value": "0", "minimum_value_warning": "wall_line_width", "default_value": 0.8, - "value": "wall_line_width * 2", + "value": "support_line_width", "limit_to_extruder": "support_infill_extruder_nr", "enabled": "support_tree_enable", "settable_per_mesh": false, @@ -3743,7 +3743,7 @@ "type": "int", "minimum_value": "0", "minimum_value_warning": "1", - "default_value": 2, + "default_value": 1, "value": "round(support_tree_wall_thickness / support_line_width)", "limit_to_extruder": "support_infill_extruder_nr", "enabled": "support_tree_enable", From 57a2bf7c5f739c4e80bfe05487546ee3aeb940d3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 13 Nov 2017 16:33:46 +0100 Subject: [PATCH 11/49] Move tree support to the top of the support category Because it's logical to have it before all of the settings that are enabled/disabled by it. Contributes to issue CURA-4523. --- resources/definitions/fdmprinter.def.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index b127b614af..81166a711e 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3338,6 +3338,14 @@ "settable_per_mesh": true, "settable_per_extruder": false }, + "support_tree_enable": + { + "label": "Tree Support", + "description": "Generate a tree-like support with branches that support your print. This may reduce material usage and print time.", + "type": "bool", + "default_value": false, + "settable_per_mesh": true + }, "support_extruder_nr": { "label": "Support Extruder", @@ -3655,14 +3663,6 @@ "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false }, - "support_tree_enable": - { - "label": "Tree Support", - "description": "Generate a tree-like support with branches that support your print. This may reduce material usage and print time.", - "type": "bool", - "default_value": false, - "settable_per_mesh": true - }, "support_tree_angle": { "label": "Tree Support Branch Angle", From bb4cb1eb7d11bc7368e3a8cf7b14379f70c644c2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 13 Nov 2017 17:58:50 +0100 Subject: [PATCH 12/49] Make support infill related settings visible if support tree enabled Because the areas generated by support trees are also filled in as normal. Contributes to issue CURA-4523. --- resources/definitions/fdmprinter.def.json | 45 ++++++++++++----------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 81166a711e..ef107be412 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3344,7 +3344,8 @@ "description": "Generate a tree-like support with branches that support your print. This may reduce material usage and print time.", "type": "bool", "default_value": false, - "settable_per_mesh": true + "settable_per_mesh": true, + "settable_per_extruder": false }, "support_extruder_nr": { @@ -3385,7 +3386,7 @@ "type": "extruder", "default_value": "0", "value": "support_extruder_nr", - "enabled": "support_enable and machine_extruder_count > 1", + "enabled": "(support_enable or support_tree_enable) and machine_extruder_count > 1", "settable_per_mesh": false, "settable_per_extruder": false, "children": @@ -3397,7 +3398,7 @@ "type": "extruder", "default_value": "0", "value": "support_interface_extruder_nr", - "enabled": "support_enable and machine_extruder_count > 1", + "enabled": "(support_enable or support_tree_enable) and machine_extruder_count > 1", "settable_per_mesh": false, "settable_per_extruder": false }, @@ -3462,7 +3463,7 @@ "cross": "Cross" }, "default_value": "zigzag", - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false, "settable_per_extruder": true @@ -3473,7 +3474,7 @@ "description": "Connect the ZigZags. This will increase the strength of the zig zag support structure.", "type": "bool", "default_value": true, - "enabled": "support_enable and (support_pattern == 'zigzag')", + "enabled": "(support_enable or support_tree_enable) and support_pattern == 'zigzag'", "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false, "settable_per_extruder": true @@ -3487,7 +3488,7 @@ "minimum_value": "0", "maximum_value_warning": "100", "default_value": 15, - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false, "settable_per_extruder": true, @@ -3502,7 +3503,7 @@ "minimum_value": "0", "minimum_value_warning": "support_line_width", "default_value": 2.66, - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "value": "0 if support_infill_rate == 0 else (support_line_width * 100) / support_infill_rate * (2 if support_pattern == 'grid' else (3 if support_pattern == 'triangles' else 1))", "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false, @@ -3579,7 +3580,7 @@ }, "default_value": "z_overrides_xy", "limit_to_extruder": "support_infill_extruder_nr", - "enabled": "support_enable or support_tree_enable", + "enabled": "support_enable", "settable_per_mesh": true }, "support_xy_distance_overhang": @@ -3593,7 +3594,7 @@ "default_value": 0.2, "value": "machine_nozzle_size / 2", "limit_to_extruder": "support_infill_extruder_nr", - "enabled": "(support_enable or support_tree_enable) and support_xy_overrides_z == 'z_overrides_xy'", + "enabled": "support_enable and support_xy_overrides_z == 'z_overrides_xy'", "settable_per_mesh": true }, "support_bottom_stair_step_height": @@ -3761,7 +3762,7 @@ "minimum_value": "0", "maximum_value_warning": "1 if (support_pattern == 'cross' or support_pattern == 'lines' or support_pattern == 'zigzag' or support_pattern == 'concentric' or support_pattern == 'concentric_3d') else 5", "maximum_value": "999999 if support_line_distance == 0 else (20 - math.log(support_line_distance) / math.log(2))", - "enabled": "support_enable and support_infill_rate > 0", + "enabled": "(support_enable or support_tree_enable) and support_infill_rate > 0", "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false }, @@ -3774,7 +3775,7 @@ "default_value": 1, "minimum_value": "0.0001", "minimum_value_warning": "3 * resolveOrValue('layer_height')", - "enabled": "support_enable and support_infill_rate > 0 and gradual_support_infill_steps > 0", + "enabled": "(support_enable or support_tree_enable) and support_infill_rate > 0 and gradual_support_infill_steps > 0", "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false }, @@ -3785,7 +3786,7 @@ "type": "bool", "default_value": false, "limit_to_extruder": "support_interface_extruder_nr", - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "settable_per_mesh": true, "children": { @@ -3797,7 +3798,7 @@ "default_value": false, "value": "extruderValue(support_roof_extruder_nr, 'support_interface_enable')", "limit_to_extruder": "support_roof_extruder_nr", - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "settable_per_mesh": true }, "support_bottom_enable": @@ -3824,7 +3825,7 @@ "minimum_value_warning": "0.2 + layer_height", "maximum_value_warning": "10", "limit_to_extruder": "support_interface_extruder_nr", - "enabled": "support_interface_enable and support_enable", + "enabled": "support_interface_enable and (support_enable or support_tree_enable)", "settable_per_mesh": true, "children": { @@ -3840,7 +3841,7 @@ "maximum_value_warning": "10", "value": "extruderValue(support_roof_extruder_nr, 'support_interface_height')", "limit_to_extruder": "support_roof_extruder_nr", - "enabled": "support_roof_enable and support_enable", + "enabled": "support_roof_enable and (support_enable or support_tree_enable)", "settable_per_mesh": true }, "support_bottom_height": @@ -3855,7 +3856,7 @@ "minimum_value_warning": "min(0.2 + layer_height, support_bottom_stair_step_height)", "maximum_value_warning": "10", "limit_to_extruder": "support_bottom_extruder_nr", - "enabled": "support_bottom_enable and support_enable", + "enabled": "support_bottom_enable and (support_enable or support_tree_enable)", "settable_per_mesh": true } } @@ -3882,7 +3883,7 @@ "minimum_value": "0", "maximum_value_warning": "100", "limit_to_extruder": "support_interface_extruder_nr", - "enabled": "support_interface_enable and support_enable", + "enabled": "support_interface_enable and (support_enable or support_tree_enable)", "settable_per_mesh": false, "settable_per_extruder": true, "children": @@ -3897,7 +3898,7 @@ "minimum_value": "0", "maximum_value": "100", "limit_to_extruder": "support_roof_extruder_nr", - "enabled": "support_roof_enable and support_enable", + "enabled": "support_roof_enable and (support_enable or support_tree_enable)", "value": "extruderValue(support_roof_extruder_nr, 'support_interface_density')", "settable_per_mesh": false, "settable_per_extruder": true, @@ -3914,7 +3915,7 @@ "minimum_value_warning": "support_roof_line_width - 0.0001", "value": "0 if support_roof_density == 0 else (support_roof_line_width * 100) / support_roof_density * (2 if support_roof_pattern == 'grid' else (3 if support_roof_pattern == 'triangles' else 1))", "limit_to_extruder": "support_roof_extruder_nr", - "enabled": "support_roof_enable and support_enable", + "enabled": "support_roof_enable and (support_enable or support_tree_enable)", "settable_per_mesh": false, "settable_per_extruder": true } @@ -3971,7 +3972,7 @@ }, "default_value": "concentric", "limit_to_extruder": "support_interface_extruder_nr", - "enabled": "support_interface_enable and support_enable", + "enabled": "support_interface_enable and (support_enable or support_tree_enable)", "settable_per_mesh": false, "settable_per_extruder": true, "children": @@ -3993,7 +3994,7 @@ "default_value": "concentric", "value": "extruderValue(support_roof_extruder_nr, 'support_interface_pattern')", "limit_to_extruder": "support_roof_extruder_nr", - "enabled": "support_roof_enable and support_enable", + "enabled": "support_roof_enable and (support_enable or support_tree_enable)", "settable_per_mesh": false, "settable_per_extruder": true }, @@ -4014,7 +4015,7 @@ "default_value": "concentric", "value": "extruderValue(support_bottom_extruder_nr, 'support_interface_pattern')", "limit_to_extruder": "support_bottom_extruder_nr", - "enabled": "support_bottom_enable and support_enable", + "enabled": "support_bottom_enable and (support_enable or support_tree_enable)", "settable_per_mesh": false, "settable_per_extruder": true } From 7c85b222b2cff55deb93d42e4431bc264c08c58b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 14 Nov 2017 17:45:45 +0100 Subject: [PATCH 13/49] Don't use support infill by default when printing tree support Only when using area support really. Contributes to issue CURA-4523. --- 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 ef107be412..ee6996b2de 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3488,6 +3488,7 @@ "minimum_value": "0", "maximum_value_warning": "100", "default_value": 15, + "value": "15 if support_enable else 0", "enabled": "support_enable or support_tree_enable", "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false, From fc187d100a6aaf37e3ef3dd22ea30b84c694f9fe Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 15 Nov 2017 16:00:42 +0100 Subject: [PATCH 14/49] Add setting to tweak collision area sampling resolution Because this can make a lot of difference for the slice time and the stability of the support. Contributes to issue CURA-4523. --- 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 ee6996b2de..db2ee3dc90 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3722,6 +3722,22 @@ "settable_per_mesh": false, "settable_per_extruder": true }, + "support_tree_collision_resolution": + { + "label": "Tree Support Collision Resolution", + "description": "Resolution to compute collisions with to avoid hitting the model. Setting this lower will produce more accurate trees that fail less often, but increases slicing time dramatically.", + "unit": "mm", + "type": "float", + "minimum_value": "0.001", + "minimum_value_warning": "support_line_width / 4", + "maximum_value_warning": "support_line_width * 2", + "default_value": 0.4, + "value": "support_line_width", + "limit_to_extruder": "support_infill_extruder_nr", + "enabled": "support_tree_enable and support_tree_branch_diameter_angle > 0", + "settable_per_mesh": false, + "settable_per_extruder": true + }, "support_tree_wall_thickness": { "label": "Tree Support Wall Thickness", From 948301c531e776dc0fdf82659153ddaab64dd22c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 12 Dec 2017 09:28:42 +0100 Subject: [PATCH 15/49] Remove duplicate setting definition I think this was a merge conflict. Contributes to issue CURA-4523. --- resources/definitions/fdmprinter.def.json | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 46991dd6e6..fcd73bdf00 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -4226,16 +4226,6 @@ "limit_to_extruder": "support_infill_extruder_nr", "enabled": "support_enable and support_use_towers", "settable_per_mesh": true - }, - "remove_empty_first_layers": - { - "label": "Remove Empty First Layers", - "description": "Remove empty layers beneath the first printed layer if they are present. Disabling this setting can cause empty first layers if the Slicing Tolerance setting is set to Exclusive or Middle.", - "type": "bool", - "default_value": true, - "enabled": "not support_enable and not support_tree_enable", - "settable_per_mesh": false, - "settable_per_extruder": false } } }, From 2451e903706f7ca92ed7b3048218cabec123a3e2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 18 Dec 2017 09:57:03 +0100 Subject: [PATCH 16/49] Increase default resolution for tree support Otherwise you get lines falling completely next to the previous layer. Contributes to issue CURA-4523. --- 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 fcd73bdf00..8438bf1fa3 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3869,7 +3869,7 @@ "minimum_value_warning": "support_line_width / 4", "maximum_value_warning": "support_line_width * 2", "default_value": 0.4, - "value": "support_line_width", + "value": "support_line_width / 2", "limit_to_extruder": "support_infill_extruder_nr", "enabled": "support_tree_enable and support_tree_branch_diameter_angle > 0", "settable_per_mesh": false, From f538c3a6863a6327d81d46645e30712024afc376 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 18 Dec 2017 14:53:24 +0100 Subject: [PATCH 17/49] Allow support bottom extruder to be set with tree support It is now implemented. Contributes to issue CURA-4523. --- resources/definitions/fdmprinter.def.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 8438bf1fa3..cfad51eeb5 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3546,7 +3546,7 @@ "type": "extruder", "default_value": "0", "value": "support_interface_extruder_nr", - "enabled": "support_enable and machine_extruder_count > 1", + "enabled": "(support_enable or support_tree_enable) and machine_extruder_count > 1", "settable_per_mesh": false, "settable_per_extruder": false } @@ -3963,7 +3963,7 @@ "default_value": false, "value": "extruderValue(support_bottom_extruder_nr, 'support_interface_enable')", "limit_to_extruder": "support_bottom_extruder_nr", - "enabled": "support_enable", + "enabled": "support_enable or support_tree_enable", "settable_per_mesh": true } } @@ -4085,7 +4085,7 @@ "minimum_value": "0", "maximum_value": "100", "limit_to_extruder": "support_bottom_extruder_nr", - "enabled": "support_bottom_enable and support_enable", + "enabled": "support_bottom_enable and (support_enable or support_tree_enable)", "value": "extruderValue(support_bottom_extruder_nr, 'support_interface_density')", "settable_per_mesh": false, "settable_per_extruder": true, @@ -4102,7 +4102,7 @@ "minimum_value_warning": "support_bottom_line_width - 0.0001", "value": "0 if support_bottom_density == 0 else (support_bottom_line_width * 100) / support_bottom_density * (2 if support_bottom_pattern == 'grid' else (3 if support_bottom_pattern == 'triangles' else 1))", "limit_to_extruder": "support_bottom_extruder_nr", - "enabled": "support_bottom_enable and support_enable", + "enabled": "support_bottom_enable and (support_enable or support_tree_enable)", "settable_per_mesh": false, "settable_per_extruder": true } From 97b051907fb90ef991a5f9ed55cd28142c6fe35c Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Mon, 18 Dec 2017 14:52:25 +0000 Subject: [PATCH 18/49] Added infill_enable_travel_optimization setting. Enabling this can greatly reduce the travel time during the printing of infill but it can be expensive to compute so now the user can decide whether to use it or not. --- 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 24f7efe373..ae8b93c3bb 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1853,6 +1853,14 @@ "settable_per_mesh": true } } + }, + "infill_enable_travel_optimization": + { + "label": "Enable Travel Optimization", + "description": "When enabled, the order in which the infill lines are printed is optimized to reduce the distance travelled. The reduction in travel time achieved very much depends on the model being sliced, infill pattern, density, etc. Note that, for some models that have many small areas of infill, the time to slice the model may be greatly increased.", + "type": "bool", + "default_value": false, + "settable_per_mesh": true } } }, From 57a9b709e72d9053fc5d883aff6fbd45e24f66c2 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 19 Dec 2017 12:14:58 +0100 Subject: [PATCH 19/49] Select text when gaining focus --- resources/qml/Settings/SettingTextField.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index 8a51f2baff..b87c8a05c8 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -17,6 +17,7 @@ SettingItem { textHasChanged = false; textBeforeEdit = focusItem.text; + focusItem.selectAll(); } contents: Rectangle From 192db52d4860c495601fc71ca40f4f89b84f5227 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 2 Jan 2018 16:27:13 +0100 Subject: [PATCH 20/49] Spelling We hold American English, at least for user-visible parts. --- plugins/SliceInfoPlugin/SliceInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 508d174cf2..45402c9c40 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -40,7 +40,7 @@ class SliceInfo(Extension): Preferences.getInstance().addPreference("info/asked_send_slice_info", False) if not Preferences.getInstance().getValue("info/asked_send_slice_info") and Preferences.getInstance().getValue("info/send_slice_info"): - self.send_slice_info_message = Message(catalog.i18nc("@info", "Cura collects anonymised slicing statistics. You can disable this in the preferences."), + self.send_slice_info_message = Message(catalog.i18nc("@info", "Cura collects anonymized slicing statistics. You can disable this in the preferences."), lifetime = 0, dismissable = False, title = catalog.i18nc("@info:title", "Collecting Data")) From 77c8ac3950c2cc50131c0011b9d4078c9f60b787 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Wed, 3 Jan 2018 11:46:20 +0100 Subject: [PATCH 21/49] Layout fixes for controls 2.0 --- resources/qml/Settings/SettingComboBox.qml | 49 +++++++++++-------- resources/qml/Settings/SettingExtruder.qml | 11 ++++- .../qml/Settings/SettingOptionalExtruder.qml | 9 +++- 3 files changed, 44 insertions(+), 25 deletions(-) diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index eaa22e1a9f..63ed5d2030 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -16,42 +16,43 @@ SettingItem id: control model: definition.options - textRole: "value"; + textRole: "value" anchors.fill: parent MouseArea { - anchors.fill: parent; - acceptedButtons: Qt.NoButton; - onWheel: wheel.accepted = true; + anchors.fill: parent + acceptedButtons: Qt.NoButton + onWheel: wheel.accepted = true } background: Rectangle { color: { - if(!enabled) - { + if (!enabled) { return UM.Theme.getColor("setting_control_disabled") } - if(control.hovered || control.activeFocus) - { + + if (control.hovered || control.activeFocus) { return UM.Theme.getColor("setting_control_highlight") } + return UM.Theme.getColor("setting_control") } + border.width: UM.Theme.getSize("default_lining").width border.color: { - if(!enabled) - { + if (!enabled) { return UM.Theme.getColor("setting_control_disabled_border") } - if(control.hovered || control.activeFocus) - { + + if (control.hovered || control.activeFocus) { return UM.Theme.getColor("setting_control_border_highlight") } + return UM.Theme.getColor("setting_control_border") } } @@ -68,29 +69,34 @@ SettingItem sourceSize.width: width + 5 * screenScaleFactor sourceSize.height: width + 5 * screenScaleFactor - color: UM.Theme.getColor("setting_control_text"); + color: UM.Theme.getColor("setting_control_text") } contentItem: Label { - text: control.currentText; - font: UM.Theme.getFont("default"); - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); - elide: Text.ElideRight; - verticalAlignment: Text.AlignVCenter; + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.left + + text: control.currentText + font: UM.Theme.getFont("default") + color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter } onActivated: { - forceActiveFocus(); - propertyProvider.setPropertyValue("value", definition.options[index].key); + forceActiveFocus() + propertyProvider.setPropertyValue("value", definition.options[index].key) } onActiveFocusChanged: { if(activeFocus) { - base.focusReceived(); + base.focusReceived() } } @@ -98,6 +104,7 @@ SettingItem { base.setActiveFocusToNextSetting(true) } + Keys.onBacktabPressed: { base.setActiveFocusToNextSetting(false) diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 0568343b8c..94e565551a 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -107,14 +107,18 @@ SettingItem return UM.Theme.getColor("setting_control_border") } } + contentItem: Item { Label { id: extruderText + anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width anchors.right: swatch.left + text: control.currentText font: UM.Theme.getFont("default") color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") @@ -122,6 +126,7 @@ SettingItem elide: Text.ElideLeft verticalAlignment: Text.AlignVCenter } + Rectangle { id: swatch @@ -129,9 +134,11 @@ SettingItem width: height anchors.right: parent.right - anchors.rightMargin: control.indicator.width + control.spacing + anchors.rightMargin: control.indicator.width + UM.Theme.getSize("setting_unit_margin").width + anchors.verticalCenter: parent.verticalCenter + anchors.margins: UM.Theme.getSize("default_margin").width / 4 - border.width: UM.Theme.getSize("default_lining").width * 2 + border.width: UM.Theme.getSize("default_lining").width border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") radius: width / 2 diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 43588edfce..e336ad4101 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -132,8 +132,10 @@ SettingItem Label { id: extruderText + anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width anchors.right: swatch.left text: control.currentText @@ -143,6 +145,7 @@ SettingItem elide: Text.ElideRight verticalAlignment: Text.AlignVCenter } + Rectangle { id: swatch @@ -150,9 +153,11 @@ SettingItem width: height anchors.right: parent.right - anchors.rightMargin: control.indicator.width + control.spacing + anchors.rightMargin: control.indicator.width + UM.Theme.getSize("setting_unit_margin").width + anchors.verticalCenter: parent.verticalCenter + anchors.margins: UM.Theme.getSize("default_margin").width / 4 - border.width: UM.Theme.getSize("default_lining").width * 2 + border.width: UM.Theme.getSize("default_lining").width border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") radius: width / 2 From 1fe653b231cd00d72bcbc92521e4434824e83912 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Wed, 3 Jan 2018 12:47:08 +0100 Subject: [PATCH 22/49] Fix combobox dropdown item height --- resources/qml/Settings/SettingComboBox.qml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index 63ed5d2030..52d0976e76 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -86,6 +86,22 @@ SettingItem verticalAlignment: Text.AlignVCenter } + delegate: ItemDelegate + { + width: control.width + height: control.height + highlighted: control.highlightedIndex == index + + contentItem: Text + { + text: modelData.value + color: control.contentItem.color + font: control.font + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + } + } + onActivated: { forceActiveFocus() @@ -118,16 +134,14 @@ SettingItem { // FIXME this needs to go away once 'resolve' is combined with 'value' in our data model. var value = undefined; - if ((base.resolve != "None") && (base.stackLevel != 0) && (base.stackLevel != 1)) - { + if ((base.resolve != "None") && (base.stackLevel != 0) && (base.stackLevel != 1)) { // We have a resolve function. Indicates that the setting is not settable per extruder and that // we have to choose between the resolved value (default) and the global value // (if user has explicitly set this). value = base.resolve; } - if (value == undefined) - { + if (value == undefined) { value = propertyProvider.properties.value; } From 3a2b2d33338d37bad61fdf17d3a046e9614d5f8c Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Wed, 3 Jan 2018 12:48:33 +0100 Subject: [PATCH 23/49] Also fix combobox list item heights for extruder dropdowns --- resources/qml/Settings/SettingExtruder.qml | 16 ++++++++++++++++ .../qml/Settings/SettingOptionalExtruder.qml | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 94e565551a..dae6171bbf 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -145,5 +145,21 @@ SettingItem color: control.color } } + + delegate: ItemDelegate + { + width: control.width + height: control.height + highlighted: control.highlightedIndex == index + + contentItem: Text + { + text: modelData.value + color: control.contentItem.color + font: control.font + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + } + } } } diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index e336ad4101..02ecfb8a2b 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -164,5 +164,21 @@ SettingItem color: control.color } } + + delegate: ItemDelegate + { + width: control.width + height: control.height + highlighted: control.highlightedIndex == index + + contentItem: Text + { + text: modelData.value + color: control.contentItem.color + font: control.font + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + } + } } } From 1fa303148605cea938d03ffdbb9820ce53222d0f Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Wed, 3 Jan 2018 12:52:40 +0100 Subject: [PATCH 24/49] Fix text color for extruder comboboxes --- resources/qml/Settings/SettingExtruder.qml | 2 +- resources/qml/Settings/SettingOptionalExtruder.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index dae6171bbf..8047231c12 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -155,7 +155,7 @@ SettingItem contentItem: Text { text: modelData.value - color: control.contentItem.color + color: extruderText.color font: control.font elide: Text.ElideRight verticalAlignment: Text.AlignVCenter diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 02ecfb8a2b..85e8c2fac7 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -174,7 +174,7 @@ SettingItem contentItem: Text { text: modelData.value - color: control.contentItem.color + color: extruderText.color font: control.font elide: Text.ElideRight verticalAlignment: Text.AlignVCenter From b7aadbe3c363deed0340e5f20cc762be7efd20e1 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Wed, 3 Jan 2018 13:08:20 +0100 Subject: [PATCH 25/49] Fix extruder dropdown text model --- resources/qml/Settings/SettingComboBox.qml | 2 +- resources/qml/Settings/SettingExtruder.qml | 4 ++-- resources/qml/Settings/SettingOptionalExtruder.qml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index 52d0976e76..2f3a13206c 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -77,7 +77,7 @@ SettingItem anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.left + anchors.right: indicator.left text: control.currentText font: UM.Theme.getFont("default") diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 8047231c12..f7b0be69f6 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -154,8 +154,8 @@ SettingItem contentItem: Text { - text: modelData.value - color: extruderText.color + text: model.name + color: UM.Theme.getColor("setting_control_text") font: control.font elide: Text.ElideRight verticalAlignment: Text.AlignVCenter diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 85e8c2fac7..b1b11f3b20 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -173,8 +173,8 @@ SettingItem contentItem: Text { - text: modelData.value - color: extruderText.color + text: model.name + color: UM.Theme.getColor("setting_control_text") font: control.font elide: Text.ElideRight verticalAlignment: Text.AlignVCenter From 1476e95adcc890add7a06700b5830449961f9c18 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Wed, 3 Jan 2018 13:45:18 +0100 Subject: [PATCH 26/49] Fix mode switching buttons functionality --- resources/qml/Sidebar.qml | 69 +++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 17 deletions(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 62b7e3bfe1..03f5c5858e 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -118,11 +118,12 @@ Rectangle UM.Preferences.setValue("cura/active_mode", currentModeIndex); if(modesListModel.count > base.currentModeIndex) { - sidebarContents.push(modesListModel.get(base.currentModeIndex).item, {"replace": true }); + sidebarContents.replace(modesListModel.get(base.currentModeIndex).item, { "replace": true }) } } - Label { + Label + { id: settingsModeLabel text: !hideSettings ? catalog.i18nc("@label:listbox", "Print Setup") : catalog.i18nc("@label:listbox","Print Setup disabled\nG-code files cannot be modified"); anchors.left: parent.left @@ -135,13 +136,18 @@ Rectangle visible: !monitoringPrint && !hideView } - Rectangle { + // Settings mode selection toggle + Rectangle + { id: settingsModeSelection color: "transparent" + width: Math.floor(parent.width * 0.55) height: UM.Theme.getSize("sidebar_header_mode_toggle").height + anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width + anchors.topMargin: UM.Theme.getSize("sidebar_margin").height anchors.top: { if (settingsModeLabel.contentWidth >= parent.width - width - UM.Theme.getSize("sidebar_margin").width * 2) @@ -153,39 +159,68 @@ Rectangle return headerSeparator.bottom; } } - anchors.topMargin: UM.Theme.getSize("sidebar_margin").height + visible: !monitoringPrint && !hideSettings && !hideView - Component{ + + Component + { id: wizardDelegate - Button { + + Button + { height: settingsModeSelection.height + width: Math.floor(0.5 * parent.width) + anchors.left: parent.left anchors.leftMargin: model.index * Math.floor(settingsModeSelection.width / 2) anchors.verticalCenter: parent.verticalCenter - width: Math.floor(0.5 * parent.width) + text: model.text - ButtonGroup.group: modeMenuGroup; - checkable: true; + + ButtonGroup.group: modeMenuGroup + + checkable: true checked: base.currentModeIndex == index + onClicked: base.currentModeIndex = index - onHoveredChanged: { + onHoveredChanged: + { if (hovered) { tooltipDelayTimer.item = settingsModeSelection tooltipDelayTimer.text = model.tooltipText - tooltipDelayTimer.start(); + tooltipDelayTimer.start() } else { - tooltipDelayTimer.stop(); - base.hideTooltip(); + tooltipDelayTimer.stop() + base.hideTooltip() } } + contentItem: Text + { + text: control.text + color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") + font: control.font + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + } + + background: Rectangle + { + border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width + border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") : control.hovered ? UM.Theme.getColor("action_button_hovered_border"): UM.Theme.getColor("action_button_border") + } } } - ButtonGroup { id: modeMenuGroup; } + + ButtonGroup + { + id: modeMenuGroup + } ListView { @@ -210,7 +245,7 @@ Rectangle anchors.right: base.right visible: !monitoringPrint && !hideSettings - pushEnter:Transition { + replaceEnter: Transition { PropertyAnimation { property: "opacity" from: 0 @@ -219,7 +254,7 @@ Rectangle } } - pushExit: Transition { + replaceExit: Transition { PropertyAnimation { property: "opacity" from: 1 @@ -560,7 +595,7 @@ Rectangle tooltipText: catalog.i18nc("@tooltip", "Custom Print Setup

Print with finegrained control over every last bit of the slicing process."), item: sidebarAdvanced }) - sidebarContents.push( modesListModel.get(base.currentModeIndex).item, {"immediate": true }); + sidebarContents.replace( modesListModel.get(base.currentModeIndex).item, { "immediate": true }) var index = Math.floor(UM.Preferences.getValue("cura/active_mode")) if(index) From 4f77b2ea6d4c6e4221abe0758ee70e19040f7d6c Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Wed, 3 Jan 2018 13:50:06 +0100 Subject: [PATCH 27/49] More layout and font fixes --- resources/qml/Settings/SettingComboBox.qml | 2 +- resources/qml/Settings/SettingExtruder.qml | 2 +- resources/qml/Settings/SettingOptionalExtruder.qml | 2 +- resources/qml/Sidebar.qml | 5 +---- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index 2f3a13206c..6168668157 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -96,7 +96,7 @@ SettingItem { text: modelData.value color: control.contentItem.color - font: control.font + font: UM.Theme.getFont("default") elide: Text.ElideRight verticalAlignment: Text.AlignVCenter } diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index f7b0be69f6..3f7f20b2b5 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -156,7 +156,7 @@ SettingItem { text: model.name color: UM.Theme.getColor("setting_control_text") - font: control.font + font: UM.Theme.getFont("default") elide: Text.ElideRight verticalAlignment: Text.AlignVCenter } diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index b1b11f3b20..4fa7ac9c6c 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -175,7 +175,7 @@ SettingItem { text: model.name color: UM.Theme.getColor("setting_control_text") - font: control.font + font: UM.Theme.getFont("default") elide: Text.ElideRight verticalAlignment: Text.AlignVCenter } diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 03f5c5858e..60469e6238 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -175,13 +175,10 @@ Rectangle anchors.leftMargin: model.index * Math.floor(settingsModeSelection.width / 2) anchors.verticalCenter: parent.verticalCenter - text: model.text - ButtonGroup.group: modeMenuGroup checkable: true checked: base.currentModeIndex == index - onClicked: base.currentModeIndex = index onHoveredChanged: @@ -201,7 +198,7 @@ Rectangle contentItem: Text { - text: control.text + text: model.text color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") font: control.font horizontalAlignment: Text.AlignHCenter From 1686f951c9ea64dcaf6cc0927fa052ee88e62754 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Wed, 3 Jan 2018 14:02:35 +0100 Subject: [PATCH 28/49] Finish styling mode switch buttons --- resources/qml/Sidebar.qml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 60469e6238..59d59798bb 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -168,6 +168,8 @@ Rectangle Button { + id: control + height: settingsModeSelection.height width: Math.floor(0.5 * parent.width) @@ -196,20 +198,22 @@ Rectangle } } - contentItem: Text - { - text: model.text - color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") - font: control.font - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - } - background: Rectangle { border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") : control.hovered ? UM.Theme.getColor("action_button_hovered_border"): UM.Theme.getColor("action_button_border") + + // for some reason, QtQuick decided to use the color of the background property as text color for the contentItem, so here it is + color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") + } + + contentItem: Text + { + text: model.text + font: UM.Theme.getFont("default") + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight } } } From e18b3b36697f4fc6ee571540b4a4f1484faafdc5 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 3 Jan 2018 17:29:49 +0100 Subject: [PATCH 29/49] Remove duplicate setting Some merge conflict, I think. Contributes to issue CURA-4523. --- resources/definitions/fdmprinter.def.json | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index cfad51eeb5..15047be75a 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -5377,22 +5377,7 @@ "enabled": "support_enable and (support_pattern == 'zigzag') and support_skip_some_zags", "limit_to_extruder": "support_infill_extruder_nr", "settable_per_mesh": false, - "settable_per_extruder": true, - "children": { - "support_zag_skip_count": { - "label": "Support Chunk Line Count", - "description": "Skip one in every N connection lines to make the support structure easier to break away.", - "type": "int", - "default_value": 5, - "value": "0 if support_line_distance == 0 else round(support_skip_zag_per_mm / support_line_distance)", - "minimum_value": "1", - "minimum_value_warning": "3", - "enabled": "support_enable and (support_pattern == 'zigzag') and support_skip_some_zags", - "limit_to_extruder": "support_infill_extruder_nr", - "settable_per_mesh": false, - "settable_per_extruder": true - } - } + "settable_per_extruder": true } } }, From 3f7d8997a16ee18c8a8e73ede68d084a88b04047 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 4 Jan 2018 11:33:12 +0100 Subject: [PATCH 30/49] Fix icon positions - CURA-4758 --- resources/qml/Settings/SettingCategory.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/Settings/SettingCategory.qml b/resources/qml/Settings/SettingCategory.qml index 5430306982..402f76b1c3 100644 --- a/resources/qml/Settings/SettingCategory.qml +++ b/resources/qml/Settings/SettingCategory.qml @@ -110,7 +110,7 @@ Button id: category_arrow anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_margin").width * 3 - width / 2 + anchors.rightMargin: UM.Theme.getSize("default_margin").width width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height sourceSize.width: width @@ -223,7 +223,7 @@ Button anchors { right: inheritButton.visible ? inheritButton.left : parent.right - rightMargin: inheritButton.visible? UM.Theme.getSize("default_margin").width / 2 : UM.Theme.getSize("setting_preferences_button_margin").width + rightMargin: inheritButton.visible ? UM.Theme.getSize("default_margin").width / 2 : category_arrow.width + UM.Theme.getSize("default_margin").width * 1.9 // 1.9 because there is a 0.1 difference between the settings and inheritance warning icons verticalCenter: parent.verticalCenter; } @@ -242,7 +242,7 @@ Button anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("setting_preferences_button_margin").width + anchors.rightMargin: category_arrow.width + UM.Theme.getSize("default_margin").width * 2 visible: { From 4cec27b1812e6b12669bb4373b123b409058f16a Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 4 Jan 2018 11:53:34 +0100 Subject: [PATCH 31/49] Fix QML warnings for combo boxes - CURA-4758 --- resources/qml/Settings/SettingComboBox.qml | 2 +- resources/qml/Settings/SettingExtruder.qml | 2 +- resources/qml/Settings/SettingOptionalExtruder.qml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index 6168668157..325b1f2a30 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -77,7 +77,7 @@ SettingItem anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width anchors.verticalCenter: parent.verticalCenter - anchors.right: indicator.left + anchors.right: downArrow.left text: control.currentText font: UM.Theme.getFont("default") diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 3f7f20b2b5..cc47ebea44 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -134,7 +134,7 @@ SettingItem width: height anchors.right: parent.right - anchors.rightMargin: control.indicator.width + UM.Theme.getSize("setting_unit_margin").width + anchors.rightMargin: downArrow.width + UM.Theme.getSize("setting_unit_margin").width anchors.verticalCenter: parent.verticalCenter anchors.margins: UM.Theme.getSize("default_margin").width / 4 diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 4fa7ac9c6c..9ca3eaaf4f 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -153,7 +153,7 @@ SettingItem width: height anchors.right: parent.right - anchors.rightMargin: control.indicator.width + UM.Theme.getSize("setting_unit_margin").width + anchors.rightMargin: downArrow.width + UM.Theme.getSize("setting_unit_margin").width anchors.verticalCenter: parent.verticalCenter anchors.margins: UM.Theme.getSize("default_margin").width / 4 From 84adbc5f41ffd8f2648d001b50c35c1b78a017a8 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 4 Jan 2018 13:26:12 +0100 Subject: [PATCH 32/49] Use the 5.8 versions of QtQuick modules in QMLs CURA-4758 --- resources/qml/Settings/SettingCategory.qml | 4 ++-- resources/qml/Settings/SettingCheckBox.qml | 4 ++-- resources/qml/Settings/SettingComboBox.qml | 4 ++-- resources/qml/Settings/SettingExtruder.qml | 4 ++-- resources/qml/Settings/SettingItem.qml | 4 ++-- resources/qml/Settings/SettingOptionalExtruder.qml | 4 ++-- resources/qml/Settings/SettingTextField.qml | 4 ++-- resources/qml/Settings/SettingUnknown.qml | 4 ++-- resources/qml/Settings/SettingView.qml | 2 +- resources/qml/Sidebar.qml | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/resources/qml/Settings/SettingCategory.qml b/resources/qml/Settings/SettingCategory.qml index 402f76b1c3..7804d1f496 100644 --- a/resources/qml/Settings/SettingCategory.qml +++ b/resources/qml/Settings/SettingCategory.qml @@ -1,8 +1,8 @@ // Copyright (c) 2017 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import QtQuick.Controls 2.0 +import QtQuick 2.8 +import QtQuick.Controls 2.1 import UM 1.1 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Settings/SettingCheckBox.qml b/resources/qml/Settings/SettingCheckBox.qml index 651ee91366..2aad6181d8 100644 --- a/resources/qml/Settings/SettingCheckBox.qml +++ b/resources/qml/Settings/SettingCheckBox.qml @@ -1,9 +1,9 @@ // Copyright (c) 2015 Ultimaker B.V. // Uranium is released under the terms of the LGPLv3 or higher. -import QtQuick 2.1 +import QtQuick 2.8 import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 import UM 1.2 as UM diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index 325b1f2a30..63d13ae514 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -1,8 +1,8 @@ // Copyright (c) 2015 Ultimaker B.V. // Uranium is released under the terms of the LGPLv3 or higher. -import QtQuick 2.1 -import QtQuick.Controls 2.0 +import QtQuick 2.8 +import QtQuick.Controls 2.1 import UM 1.1 as UM diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index cc47ebea44..6ad1ce942e 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -1,8 +1,8 @@ // Copyright (c) 2016 Ultimaker B.V. // Uranium is released under the terms of the LGPLv3 or higher. -import QtQuick 2.1 -import QtQuick.Controls 2.0 +import QtQuick 2.8 +import QtQuick.Controls 2.1 import UM 1.1 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index 278d9a9ce2..1b1f302846 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -1,9 +1,9 @@ // Copyright (c) 2017 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.1 +import QtQuick 2.8 import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.1 import UM 1.1 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 9ca3eaaf4f..3f6182e06c 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -1,8 +1,8 @@ // Copyright (c) 2016 Ultimaker B.V. // Uranium is released under the terms of the LGPLv3 or higher. -import QtQuick 2.1 -import QtQuick.Controls 2.0 +import QtQuick 2.8 +import QtQuick.Controls 2.1 import UM 1.1 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index 2f0c776eb6..30dff2490f 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -1,8 +1,8 @@ // Copyright (c) 2017 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import QtQuick.Controls 2.0 +import QtQuick 2.8 +import QtQuick.Controls 2.1 import UM 1.1 as UM diff --git a/resources/qml/Settings/SettingUnknown.qml b/resources/qml/Settings/SettingUnknown.qml index bca786dc0d..82d54f96b8 100644 --- a/resources/qml/Settings/SettingUnknown.qml +++ b/resources/qml/Settings/SettingUnknown.qml @@ -1,8 +1,8 @@ // Copyright (c) 2015 Ultimaker B.V. // Uranium is released under the terms of the LGPLv3 or higher. -import QtQuick 2.1 -import QtQuick.Controls 2.0 +import QtQuick 2.8 +import QtQuick.Controls 2.1 import UM 1.2 as UM diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 5d39572647..6929614830 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -1,7 +1,7 @@ // Copyright (c) 2017 Ultimaker B.V. // Uranium is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.8 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 import QtQuick.Layouts 1.1 diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 1b498c6024..326d5a0447 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -1,8 +1,8 @@ // Copyright (c) 2017 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import QtQuick.Controls 2.0 +import QtQuick 2.8 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 import UM 1.2 as UM From d20895a05594b3ce8f52b42f2100006787652395 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 4 Jan 2018 13:51:45 +0100 Subject: [PATCH 33/49] Fix code style CURA-4758 --- resources/qml/Settings/SettingCategory.qml | 110 +++++++----------- resources/qml/Settings/SettingExtruder.qml | 8 +- .../qml/Settings/SettingOptionalExtruder.qml | 8 +- resources/qml/Sidebar.qml | 22 ++-- 4 files changed, 59 insertions(+), 89 deletions(-) diff --git a/resources/qml/Settings/SettingCategory.qml b/resources/qml/Settings/SettingCategory.qml index 7804d1f496..cc7ca9354d 100644 --- a/resources/qml/Settings/SettingCategory.qml +++ b/resources/qml/Settings/SettingCategory.qml @@ -9,24 +9,24 @@ import Cura 1.0 as Cura Button { - id: base; + id: base anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width background: Rectangle { - implicitHeight: UM.Theme.getSize("section").height; + implicitHeight: UM.Theme.getSize("section").height color: { - if(base.color) { + if (base.color) { return base.color; - } else if(!base.enabled) { + } else if (!base.enabled) { return UM.Theme.getColor("setting_category_disabled"); - } else if(base.hovered && base.checkable && base.checked) { + } else if (base.hovered && base.checkable && base.checked) { return UM.Theme.getColor("setting_category_active_hover"); - } else if(base.pressed || (base.checkable && base.checked)) { + } else if (base.pressed || (base.checkable && base.checked)) { return UM.Theme.getColor("setting_category_active"); - } else if(base.hovered) { + } else if (base.hovered) { return UM.Theme.getColor("setting_category_hover"); } else { return UM.Theme.getColor("setting_category"); @@ -39,13 +39,13 @@ Button width: parent.width anchors.bottom: parent.bottom color: { - if(!base.enabled) { + if (!base.enabled) { return UM.Theme.getColor("setting_category_disabled_border"); - } else if((base.hovered || base.activeFocus) && base.checkable && base.checked) { + } else if ((base.hovered || base.activeFocus) && base.checkable && base.checked) { return UM.Theme.getColor("setting_category_active_hover_border"); - } else if(base.pressed || (base.checkable && base.checked)) { + } else if (base.pressed || (base.checkable && base.checked)) { return UM.Theme.getColor("setting_category_active_border"); - } else if(base.hovered || base.activeFocus) { + } else if (base.hovered || base.activeFocus) { return UM.Theme.getColor("setting_category_hover_border"); } else { return UM.Theme.getColor("setting_category_border"); @@ -66,7 +66,7 @@ Button //text: definition.label contentItem: Item { - anchors.fill: parent; + anchors.fill: parent anchors.left: parent.left Label { @@ -78,31 +78,22 @@ Button verticalCenter: parent.verticalCenter; } text: definition.label - font: UM.Theme.getFont("setting_category"); + font: UM.Theme.getFont("setting_category") color: { - if(!base.enabled) - { + if (!base.enabled) { return UM.Theme.getColor("setting_category_disabled_text"); - } - else if((base.hovered || base.activeFocus) && base.checkable && base.checked) - { + } else if ((base.hovered || base.activeFocus) && base.checkable && base.checked) { return UM.Theme.getColor("setting_category_active_hover_text"); - } - else if(base.pressed || (base.checkable && base.checked)) - { + } else if (base.pressed || (base.checkable && base.checked)) { return UM.Theme.getColor("setting_category_active_text"); - } - else if(base.hovered || base.activeFocus) - { + } else if (base.hovered || base.activeFocus) { return UM.Theme.getColor("setting_category_hover_text"); - } - else - { + } else { return UM.Theme.getColor("setting_category_text"); } } - fontSizeMode: Text.HorizontalFit; + fontSizeMode: Text.HorizontalFit minimumPointSize: 8 } UM.RecolorImage @@ -117,24 +108,15 @@ Button sourceSize.height: width color: { - if(!base.enabled) - { + if (!base.enabled) { return UM.Theme.getColor("setting_category_disabled_text"); - } - else if((base.hovered || base.activeFocus) && base.checkable && base.checked) - { + } else if ((base.hovered || base.activeFocus) && base.checkable && base.checked) { return UM.Theme.getColor("setting_category_active_hover_text"); - } - else if(base.pressed || (base.checkable && base.checked)) - { + } else if (base.pressed || (base.checkable && base.checked)) { return UM.Theme.getColor("setting_category_active_text"); - } - else if(base.hovered || base.activeFocus) - { + } else if (base.hovered || base.activeFocus) { return UM.Theme.getColor("setting_category_hover_text"); - } - else - { + } else { return UM.Theme.getColor("setting_category_text"); } } @@ -150,24 +132,15 @@ Button anchors.leftMargin: UM.Theme.getSize("default_margin").width color: { - if(!base.enabled) - { + if (!base.enabled) { return UM.Theme.getColor("setting_category_disabled_text"); - } - else if((base.hovered || base.activeFocus) && base.checkable && base.checked) - { + } else if((base.hovered || base.activeFocus) && base.checkable && base.checked) { return UM.Theme.getColor("setting_category_active_hover_text"); - } - else if(base.pressed || (base.checkable && base.checked)) - { + } else if(base.pressed || (base.checkable && base.checked)) { return UM.Theme.getColor("setting_category_active_text"); - } - else if(base.hovered || base.activeFocus) - { + } else if(base.hovered || base.activeFocus) { return UM.Theme.getColor("setting_category_hover_text"); - } - else - { + } else { return UM.Theme.getColor("setting_category_text"); } } @@ -178,18 +151,14 @@ Button sourceSize.height: width + 15 * screenScaleFactor } - checkable: true checked: definition.expanded onClicked: { - if(definition.expanded) - { + if (definition.expanded) { settingDefinitionsModel.collapse(definition.key); - } - else - { + } else { settingDefinitionsModel.expandAll(definition.key); } //Set focus so that tab navigation continues from this point on. @@ -223,13 +192,14 @@ Button anchors { right: inheritButton.visible ? inheritButton.left : parent.right - rightMargin: inheritButton.visible ? UM.Theme.getSize("default_margin").width / 2 : category_arrow.width + UM.Theme.getSize("default_margin").width * 1.9 // 1.9 because there is a 0.1 difference between the settings and inheritance warning icons - verticalCenter: parent.verticalCenter; + // use 1.9 as the factor because there is a 0.1 difference between the settings and inheritance warning icons + rightMargin: inheritButton.visible ? UM.Theme.getSize("default_margin").width / 2 : category_arrow.width + UM.Theme.getSize("default_margin").width * 1.9 + verticalCenter: parent.verticalCenter } - color: UM.Theme.getColor("setting_control_button"); + color: UM.Theme.getColor("setting_control_button") hoverColor: UM.Theme.getColor("setting_control_button_hover") - iconSource: UM.Theme.getIcon("settings"); + iconSource: UM.Theme.getIcon("settings") onClicked: { Cura.Actions.configureSettingVisibility.trigger(definition) @@ -238,7 +208,7 @@ Button UM.SimpleButton { - id: inheritButton; + id: inheritButton anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right @@ -246,12 +216,12 @@ Button visible: { - if(Cura.SettingInheritanceManager.settingsWithInheritanceWarning.indexOf(definition.key) >= 0) + if (Cura.SettingInheritanceManager.settingsWithInheritanceWarning.indexOf(definition.key) >= 0) { var children_with_override = Cura.SettingInheritanceManager.getChildrenKeysWithOverride(definition.key) - for(var i = 0; i < children_with_override.length; i++) + for (var i = 0; i < children_with_override.length; i++) { - if(!settingDefinitionsModel.getVisible(children_with_override[i])) + if (!settingDefinitionsModel.getVisible(children_with_override[i])) { return true } diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 6ad1ce942e..b754c3fd74 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -83,11 +83,11 @@ SettingItem { color: { - if(!enabled) + if (!enabled) { return UM.Theme.getColor("setting_control_disabled"); } - if(control.hovered || base.activeFocus) + if (control.hovered || base.activeFocus) { return UM.Theme.getColor("setting_control_highlight"); } @@ -96,11 +96,11 @@ SettingItem border.width: UM.Theme.getSize("default_lining").width border.color: { - if(!enabled) + if (!enabled) { return UM.Theme.getColor("setting_control_disabled_border") } - if(control.hovered || control.activeFocus) + if (control.hovered || control.activeFocus) { return UM.Theme.getColor("setting_control_border_highlight") } diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 3f6182e06c..3bb2a2f1e0 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -102,11 +102,11 @@ SettingItem { color: { - if(!enabled) + if (!enabled) { return UM.Theme.getColor("setting_control_disabled"); } - if(control.hovered || control.activeFocus) + if (control.hovered || control.activeFocus) { return UM.Theme.getColor("setting_control_highlight"); } @@ -115,11 +115,11 @@ SettingItem border.width: UM.Theme.getSize("default_lining").width border.color: { - if(!enabled) + if (!enabled) { return UM.Theme.getColor("setting_control_disabled_border") } - if(control.hovered || control.activeFocus) + if (control.hovered || control.activeFocus) { return UM.Theme.getColor("setting_control_border_highlight") } diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 326d5a0447..e6e0fee023 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -11,9 +11,9 @@ import "Menus" Rectangle { - id: base; + id: base - property int currentModeIndex; + property int currentModeIndex property bool hideSettings: PrintInformation.preSliced property bool hideView: Cura.MachineManager.activeMachineName == "" @@ -77,7 +77,7 @@ Rectangle MouseArea { anchors.fill: parent - acceptedButtons: Qt.AllButtons; + acceptedButtons: Qt.AllButtons onWheel: { @@ -125,7 +125,7 @@ Rectangle Label { id: settingsModeLabel - text: !hideSettings ? catalog.i18nc("@label:listbox", "Print Setup") : catalog.i18nc("@label:listbox","Print Setup disabled\nG-code files cannot be modified"); + text: !hideSettings ? catalog.i18nc("@label:listbox", "Print Setup") : catalog.i18nc("@label:listbox", "Print Setup disabled\nG-code files cannot be modified") anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width anchors.top: headerSeparator.bottom @@ -557,19 +557,19 @@ Rectangle SidebarTooltip { - id: tooltip; + id: tooltip } // Setting mode: Recommended or Custom ListModel { - id: modesListModel; + id: modesListModel } SidebarSimple { - id: sidebarSimple; - visible: false; + id: sidebarSimple + visible: false onShowTooltip: base.showTooltip(item, location, text) onHideTooltip: base.hideTooltip() @@ -577,8 +577,8 @@ Rectangle SidebarAdvanced { - id: sidebarAdvanced; - visible: false; + id: sidebarAdvanced + visible: false onShowTooltip: base.showTooltip(item, location, text) onHideTooltip: base.hideTooltip() @@ -596,7 +596,7 @@ Rectangle tooltipText: catalog.i18nc("@tooltip", "Custom Print Setup

Print with finegrained control over every last bit of the slicing process."), item: sidebarAdvanced }) - sidebarContents.replace( modesListModel.get(base.currentModeIndex).item, { "immediate": true }) + sidebarContents.replace(modesListModel.get(base.currentModeIndex).item, { "immediate": true }) var index = Math.floor(UM.Preferences.getValue("cura/active_mode")) if(index) From abdc33a0b9c44f2653a3829df5fd3168c793c0f1 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Thu, 4 Jan 2018 14:23:22 +0100 Subject: [PATCH 34/49] CURA-4672 fix auto arrange for small models, they are now rounded up to 1 pixel rasterized --- cura/Arranging/ShapeArray.py | 6 ++++++ tests/TestArrange.py | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/cura/Arranging/ShapeArray.py b/cura/Arranging/ShapeArray.py index 9232c9f22f..6ef92b1743 100644 --- a/cura/Arranging/ShapeArray.py +++ b/cura/Arranging/ShapeArray.py @@ -29,8 +29,14 @@ class ShapeArray: offset_x = int(numpy.amin(flip_vertices[:, 1])) flip_vertices[:, 0] = numpy.add(flip_vertices[:, 0], -offset_y) flip_vertices[:, 1] = numpy.add(flip_vertices[:, 1], -offset_x) + flip_vertices = numpy.ceil(flip_vertices) shape = [int(numpy.amax(flip_vertices[:, 0])), int(numpy.amax(flip_vertices[:, 1]))] + if shape == [0, 0]: + shape = [1, 1] arr = cls.arrayFromPolygon(shape, flip_vertices) + if not numpy.any(arr): + # set at least 1 pixel + arr[0][0] = 1 return cls(arr, offset_x, offset_y) ## Instantiate an offset and hull ShapeArray from a scene node. diff --git a/tests/TestArrange.py b/tests/TestArrange.py index 737305f638..4f6bb64118 100755 --- a/tests/TestArrange.py +++ b/tests/TestArrange.py @@ -118,6 +118,13 @@ def test_arrayFromPolygon2(): assert numpy.any(array) +## Polygon -> array +def test_fromPolygon(): + vertices = numpy.array([[0, 0.5], [0, 0], [0.5, 0]]) + array = ShapeArray.fromPolygon(vertices, scale=0.5) + assert numpy.any(array.arr) + + ## Line definition -> array with true/false def test_check(): base_array = numpy.zeros([5, 5], dtype=float) From 5e26ecb4589aa602ec68ad2b443b0daf712ee41a Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Thu, 4 Jan 2018 14:59:40 +0100 Subject: [PATCH 35/49] CURA-4672 now unbreak arrange for large objects as well :-) --- cura/Arranging/ShapeArray.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cura/Arranging/ShapeArray.py b/cura/Arranging/ShapeArray.py index 6ef92b1743..68be9a6478 100644 --- a/cura/Arranging/ShapeArray.py +++ b/cura/Arranging/ShapeArray.py @@ -29,12 +29,10 @@ class ShapeArray: offset_x = int(numpy.amin(flip_vertices[:, 1])) flip_vertices[:, 0] = numpy.add(flip_vertices[:, 0], -offset_y) flip_vertices[:, 1] = numpy.add(flip_vertices[:, 1], -offset_x) - flip_vertices = numpy.ceil(flip_vertices) - shape = [int(numpy.amax(flip_vertices[:, 0])), int(numpy.amax(flip_vertices[:, 1]))] - if shape == [0, 0]: - shape = [1, 1] + shape = numpy.array([int(numpy.amax(flip_vertices[:, 0])), int(numpy.amax(flip_vertices[:, 1]))]) + shape[numpy.where(shape == 0)] = 1 arr = cls.arrayFromPolygon(shape, flip_vertices) - if not numpy.any(arr): + if not numpy.ndarray.any(arr): # set at least 1 pixel arr[0][0] = 1 return cls(arr, offset_x, offset_y) From 4f224a4311bd34fb4dd80f073ade1384d1d426a4 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Thu, 4 Jan 2018 16:12:39 +0100 Subject: [PATCH 36/49] CURA-4525 do not show build plate view item when disabled --- resources/qml/Menus/ViewMenu.qml | 1 + resources/qml/ObjectsList.qml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Menus/ViewMenu.qml b/resources/qml/Menus/ViewMenu.qml index 72bc42bfb0..afc80dd314 100644 --- a/resources/qml/Menus/ViewMenu.qml +++ b/resources/qml/Menus/ViewMenu.qml @@ -50,6 +50,7 @@ Menu { id: buildPlateMenu; title: catalog.i18nc("@action:inmenu menubar:view","&Build plate"); + visible: UM.Preferences.getValue("cura/use_multi_build_plate") Instantiator { model: Cura.BuildPlateModel diff --git a/resources/qml/ObjectsList.qml b/resources/qml/ObjectsList.qml index 04afbe2fb0..a02ea2288d 100644 --- a/resources/qml/ObjectsList.qml +++ b/resources/qml/ObjectsList.qml @@ -231,7 +231,6 @@ Rectangle tooltip: ''; anchors { - //top: buildPlateSelection.bottom; topMargin: UM.Theme.getSize("default_margin").height; left: parent.left; leftMargin: UM.Theme.getSize("default_margin").height; From 2dad18a9ba5c1f547150d2e04b83369de13e12f5 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Thu, 4 Jan 2018 16:26:39 +0100 Subject: [PATCH 37/49] CURA-4761 allow for space for scrollbar in per object settings --- plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index ea126bfd44..5bdb6d4cb0 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -111,7 +111,7 @@ Item { ScrollView { height: parent.height - width: UM.Theme.getSize("setting").width + width: UM.Theme.getSize("setting").width + UM.Theme.getSize("default_margin").width style: UM.Theme.styles.scrollview ListView From 564a97d5a80545f5eebdc63de7c48a1a435ad2ea Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 4 Jan 2018 17:20:57 +0100 Subject: [PATCH 38/49] Account for getConvexHullTransformedVertices returning None It returns None if there are no vertices. --- cura/Scene/ConvexHullDecorator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Scene/ConvexHullDecorator.py b/cura/Scene/ConvexHullDecorator.py index 3a563c2764..94045652f5 100644 --- a/cura/Scene/ConvexHullDecorator.py +++ b/cura/Scene/ConvexHullDecorator.py @@ -177,7 +177,7 @@ class ConvexHullDecorator(SceneNodeDecorator): # Do not throw away vertices: the convex hull may be too small and objects can collide. # vertex_data = vertex_data[vertex_data[:,1] >= -0.01] - if len(vertex_data) >= 4: + if vertex_data and len(vertex_data) >= 4: # Round the vertex data to 1/10th of a mm, then remove all duplicate vertices # This is done to greatly speed up further convex hull calculations as the convex hull # becomes much less complex when dealing with highly detailed models. From 2c45efb70de003b431707aadfc2a3cb37e4dc39c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 4 Jan 2018 17:23:43 +0100 Subject: [PATCH 39/49] Simplify code flow a bit Use if branches for the unhappy flow, so that it's clear that this behaves as an early-out. This also prevents the need for declaring variables out of scope, which is not an issue with Python anyway. --- cura/Scene/ConvexHullDecorator.py | 67 +++++++++++++++---------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/cura/Scene/ConvexHullDecorator.py b/cura/Scene/ConvexHullDecorator.py index 94045652f5..f6b9372259 100644 --- a/cura/Scene/ConvexHullDecorator.py +++ b/cura/Scene/ConvexHullDecorator.py @@ -160,48 +160,47 @@ class ConvexHullDecorator(SceneNodeDecorator): return offset_hull else: + if not self._node.getMeshData(): #Node has no mesh data, so just return an empty Polygon. + return Polygon([]) + offset_hull = None - mesh = None - world_transform = None - if self._node.getMeshData(): - mesh = self._node.getMeshData() - world_transform = self._node.getWorldTransformation() + mesh = self._node.getMeshData() + world_transform = self._node.getWorldTransformation() - # Check the cache - if mesh is self._2d_convex_hull_mesh and world_transform == self._2d_convex_hull_mesh_world_transform: - return self._2d_convex_hull_mesh_result + # Check the cache + if mesh is self._2d_convex_hull_mesh and world_transform == self._2d_convex_hull_mesh_world_transform: + return self._2d_convex_hull_mesh_result - vertex_data = mesh.getConvexHullTransformedVertices(world_transform) - # Don't use data below 0. - # TODO; We need a better check for this as this gives poor results for meshes with long edges. - # Do not throw away vertices: the convex hull may be too small and objects can collide. - # vertex_data = vertex_data[vertex_data[:,1] >= -0.01] + vertex_data = mesh.getConvexHullTransformedVertices(world_transform) + # Don't use data below 0. + # TODO; We need a better check for this as this gives poor results for meshes with long edges. + # Do not throw away vertices: the convex hull may be too small and objects can collide. + # vertex_data = vertex_data[vertex_data[:,1] >= -0.01] - if vertex_data and len(vertex_data) >= 4: - # Round the vertex data to 1/10th of a mm, then remove all duplicate vertices - # This is done to greatly speed up further convex hull calculations as the convex hull - # becomes much less complex when dealing with highly detailed models. - vertex_data = numpy.round(vertex_data, 1) + if not vertex_data or len(vertex_data) < 4: + return Polygon([]) + # Round the vertex data to 1/10th of a mm, then remove all duplicate vertices + # This is done to greatly speed up further convex hull calculations as the convex hull + # becomes much less complex when dealing with highly detailed models. + vertex_data = numpy.round(vertex_data, 1) - vertex_data = vertex_data[:, [0, 2]] # Drop the Y components to project to 2D. + vertex_data = vertex_data[:, [0, 2]] # Drop the Y components to project to 2D. - # Grab the set of unique points. - # - # This basically finds the unique rows in the array by treating them as opaque groups of bytes - # which are as long as the 2 float64s in each row, and giving this view to numpy.unique() to munch. - # See http://stackoverflow.com/questions/16970982/find-unique-rows-in-numpy-array - vertex_byte_view = numpy.ascontiguousarray(vertex_data).view( - numpy.dtype((numpy.void, vertex_data.dtype.itemsize * vertex_data.shape[1]))) - _, idx = numpy.unique(vertex_byte_view, return_index=True) - vertex_data = vertex_data[idx] # Select the unique rows by index. + # Grab the set of unique points. + # + # This basically finds the unique rows in the array by treating them as opaque groups of bytes + # which are as long as the 2 float64s in each row, and giving this view to numpy.unique() to munch. + # See http://stackoverflow.com/questions/16970982/find-unique-rows-in-numpy-array + vertex_byte_view = numpy.ascontiguousarray(vertex_data).view( + numpy.dtype((numpy.void, vertex_data.dtype.itemsize * vertex_data.shape[1]))) + _, idx = numpy.unique(vertex_byte_view, return_index=True) + vertex_data = vertex_data[idx] # Select the unique rows by index. - hull = Polygon(vertex_data) + hull = Polygon(vertex_data) - if len(vertex_data) >= 3: - convex_hull = hull.getConvexHull() - offset_hull = self._offsetHull(convex_hull) - else: - return Polygon([]) # Node has no mesh data, so just return an empty Polygon. + if len(vertex_data) >= 3: + convex_hull = hull.getConvexHull() + offset_hull = self._offsetHull(convex_hull) # Store the result in the cache self._2d_convex_hull_mesh = mesh From 63f7902fca7b2dd90600b15aab59b6bac676964b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 Jan 2018 09:16:03 +0100 Subject: [PATCH 40/49] Revert "Simplify code flow a bit" This reverts commit 2c45efb70de003b431707aadfc2a3cb37e4dc39c. --- cura/Scene/ConvexHullDecorator.py | 67 ++++++++++++++++--------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/cura/Scene/ConvexHullDecorator.py b/cura/Scene/ConvexHullDecorator.py index f6b9372259..94045652f5 100644 --- a/cura/Scene/ConvexHullDecorator.py +++ b/cura/Scene/ConvexHullDecorator.py @@ -160,47 +160,48 @@ class ConvexHullDecorator(SceneNodeDecorator): return offset_hull else: - if not self._node.getMeshData(): #Node has no mesh data, so just return an empty Polygon. - return Polygon([]) - offset_hull = None - mesh = self._node.getMeshData() - world_transform = self._node.getWorldTransformation() + mesh = None + world_transform = None + if self._node.getMeshData(): + mesh = self._node.getMeshData() + world_transform = self._node.getWorldTransformation() - # Check the cache - if mesh is self._2d_convex_hull_mesh and world_transform == self._2d_convex_hull_mesh_world_transform: - return self._2d_convex_hull_mesh_result + # Check the cache + if mesh is self._2d_convex_hull_mesh and world_transform == self._2d_convex_hull_mesh_world_transform: + return self._2d_convex_hull_mesh_result - vertex_data = mesh.getConvexHullTransformedVertices(world_transform) - # Don't use data below 0. - # TODO; We need a better check for this as this gives poor results for meshes with long edges. - # Do not throw away vertices: the convex hull may be too small and objects can collide. - # vertex_data = vertex_data[vertex_data[:,1] >= -0.01] + vertex_data = mesh.getConvexHullTransformedVertices(world_transform) + # Don't use data below 0. + # TODO; We need a better check for this as this gives poor results for meshes with long edges. + # Do not throw away vertices: the convex hull may be too small and objects can collide. + # vertex_data = vertex_data[vertex_data[:,1] >= -0.01] - if not vertex_data or len(vertex_data) < 4: - return Polygon([]) - # Round the vertex data to 1/10th of a mm, then remove all duplicate vertices - # This is done to greatly speed up further convex hull calculations as the convex hull - # becomes much less complex when dealing with highly detailed models. - vertex_data = numpy.round(vertex_data, 1) + if vertex_data and len(vertex_data) >= 4: + # Round the vertex data to 1/10th of a mm, then remove all duplicate vertices + # This is done to greatly speed up further convex hull calculations as the convex hull + # becomes much less complex when dealing with highly detailed models. + vertex_data = numpy.round(vertex_data, 1) - vertex_data = vertex_data[:, [0, 2]] # Drop the Y components to project to 2D. + vertex_data = vertex_data[:, [0, 2]] # Drop the Y components to project to 2D. - # Grab the set of unique points. - # - # This basically finds the unique rows in the array by treating them as opaque groups of bytes - # which are as long as the 2 float64s in each row, and giving this view to numpy.unique() to munch. - # See http://stackoverflow.com/questions/16970982/find-unique-rows-in-numpy-array - vertex_byte_view = numpy.ascontiguousarray(vertex_data).view( - numpy.dtype((numpy.void, vertex_data.dtype.itemsize * vertex_data.shape[1]))) - _, idx = numpy.unique(vertex_byte_view, return_index=True) - vertex_data = vertex_data[idx] # Select the unique rows by index. + # Grab the set of unique points. + # + # This basically finds the unique rows in the array by treating them as opaque groups of bytes + # which are as long as the 2 float64s in each row, and giving this view to numpy.unique() to munch. + # See http://stackoverflow.com/questions/16970982/find-unique-rows-in-numpy-array + vertex_byte_view = numpy.ascontiguousarray(vertex_data).view( + numpy.dtype((numpy.void, vertex_data.dtype.itemsize * vertex_data.shape[1]))) + _, idx = numpy.unique(vertex_byte_view, return_index=True) + vertex_data = vertex_data[idx] # Select the unique rows by index. - hull = Polygon(vertex_data) + hull = Polygon(vertex_data) - if len(vertex_data) >= 3: - convex_hull = hull.getConvexHull() - offset_hull = self._offsetHull(convex_hull) + if len(vertex_data) >= 3: + convex_hull = hull.getConvexHull() + offset_hull = self._offsetHull(convex_hull) + else: + return Polygon([]) # Node has no mesh data, so just return an empty Polygon. # Store the result in the cache self._2d_convex_hull_mesh = mesh From 502332ee3e3492665a481a40745805649a532549 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 Jan 2018 09:17:02 +0100 Subject: [PATCH 41/49] Revert "Account for getConvexHullTransformedVertices returning None" This reverts commit 564a97d5a80545f5eebdc63de7c48a1a435ad2ea. --- cura/Scene/ConvexHullDecorator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Scene/ConvexHullDecorator.py b/cura/Scene/ConvexHullDecorator.py index 94045652f5..3a563c2764 100644 --- a/cura/Scene/ConvexHullDecorator.py +++ b/cura/Scene/ConvexHullDecorator.py @@ -177,7 +177,7 @@ class ConvexHullDecorator(SceneNodeDecorator): # Do not throw away vertices: the convex hull may be too small and objects can collide. # vertex_data = vertex_data[vertex_data[:,1] >= -0.01] - if vertex_data and len(vertex_data) >= 4: + if len(vertex_data) >= 4: # Round the vertex data to 1/10th of a mm, then remove all duplicate vertices # This is done to greatly speed up further convex hull calculations as the convex hull # becomes much less complex when dealing with highly detailed models. From 47ba8b098c8f86c8b40f5ce12a92c00d29de3ab3 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 5 Jan 2018 11:51:12 +0100 Subject: [PATCH 42/49] Apply to layers shadow shader the same changes than in the default layer shader, so that the shadow layers are correctly shown in simulation view --- plugins/SimulationView/layers3d_shadow.shader | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/plugins/SimulationView/layers3d_shadow.shader b/plugins/SimulationView/layers3d_shadow.shader index ad75fcf9d0..15136fcf3f 100644 --- a/plugins/SimulationView/layers3d_shadow.shader +++ b/plugins/SimulationView/layers3d_shadow.shader @@ -145,35 +145,42 @@ geometry41core = myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz + g_vertex_offset_vert)); myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz + g_vertex_offset_vert)); myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz_head + g_vertex_offset_vert)); + //And reverse so that the line is also visible from the back side. + myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz + g_vertex_offset_vert)); + myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz + g_vertex_offset_vert)); + myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz + g_vertex_offset_vert)); + myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz + g_vertex_offset_vert)); + myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head + g_vertex_offset_vert)); + myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz + g_vertex_offset_vert)); EndPrimitive(); } else { // All normal lines are rendered as 3d tubes. - myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz)); - myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz)); - myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_vert)); - myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_vert)); myEmitVertex(v_vertex[0], v_color[0], -g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz)); myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz)); - myEmitVertex(v_vertex[0], v_color[0], -g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_vert)); - myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_vert)); + myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_vert)); + myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_vert)); myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz)); myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz)); + myEmitVertex(v_vertex[0], v_color[0], -g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_vert)); + myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_vert)); + myEmitVertex(v_vertex[0], v_color[0], -g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz)); + myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz)); EndPrimitive(); // left side - myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz)); + myEmitVertex(v_vertex[0], v_color[0], -g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz)); myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_vert)); myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz_head, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head)); - myEmitVertex(v_vertex[0], v_color[0], -g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz)); + myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz)); EndPrimitive(); - myEmitVertex(v_vertex[0], v_color[0], -g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz)); + myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz)); myEmitVertex(v_vertex[0], v_color[0], -g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_vert)); myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz_head, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head)); - myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz)); + myEmitVertex(v_vertex[0], v_color[0], -g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz)); EndPrimitive(); From 65e87625466d50a8c7dd4f3234b899e8028abdde Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 5 Jan 2018 11:53:38 +0100 Subject: [PATCH 43/49] Fix layer height slider update issue CURA-4758 --- resources/qml/SidebarSimple.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 7aca25160a..74c2bf1ec1 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -70,6 +70,18 @@ Item onActiveVariantChanged: qualityModel.update() } + Connections { + target: base + onVisibleChanged: + { + // update needs to be called when the widgets are visible, otherwise the step width calculation + // will fail because the width of an invisible item is 0. + if (visible) { + qualityModel.update(); + } + } + } + ListModel { id: qualityModel From 223d9b6025f8d74cef42b9e0b3edbc5e20c90e43 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 5 Jan 2018 11:54:17 +0100 Subject: [PATCH 44/49] Update QtQuick import versions CURA-4758 --- resources/qml/Sidebar.qml | 2 +- resources/qml/SidebarAdvanced.qml | 5 ++--- resources/qml/SidebarSimple.qml | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index e6e0fee023..e1c0a07f89 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -3,7 +3,7 @@ import QtQuick 2.8 import QtQuick.Controls 2.1 -import QtQuick.Layouts 1.1 +import QtQuick.Layouts 1.3 import UM 1.2 as UM import Cura 1.0 as Cura diff --git a/resources/qml/SidebarAdvanced.qml b/resources/qml/SidebarAdvanced.qml index 95f218639b..f214e425b1 100644 --- a/resources/qml/SidebarAdvanced.qml +++ b/resources/qml/SidebarAdvanced.qml @@ -1,9 +1,8 @@ // Copyright (c) 2015 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.0 - -import QtQuick.Controls 1.2 +import QtQuick 2.8 +import QtQuick.Controls 2.1 import "Settings" diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 74c2bf1ec1..7e86b10207 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -1,10 +1,10 @@ // Copyright (c) 2017 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 -import QtQuick.Layouts 1.1 +import QtQuick 2.8 +import QtQuick.Controls 1.4 +import QtQuick.Controls.Styles 1.4 +import QtQuick.Layouts 1.3 import UM 1.2 as UM import Cura 1.2 as Cura From 8c98ab027a7c53dd9840f17abc14316c04a16095 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 5 Jan 2018 11:54:46 +0100 Subject: [PATCH 45/49] Fix code style CURA-4758 --- resources/qml/SidebarSimple.qml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 7e86b10207..ac124c8911 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -11,7 +11,7 @@ import Cura 1.2 as Cura Item { - id: base; + id: base signal showTooltip(Item item, point location, string text); signal hideTooltip(); @@ -115,7 +115,7 @@ Item if (Cura.SimpleModeSettingsManager.isProfileUserCreated) { qualityModel.qualitySliderActiveIndex = -1 } else { - qualityModel.qualitySliderActiveIndex = i + qualityModel.qualitySliderActiveIndex = i } qualityModel.existingQualityProfile = 1 @@ -195,11 +195,10 @@ Item text: { var result = "" - if(Cura.MachineManager.activeMachine != null){ + if (Cura.MachineManager.activeMachine != null) { + result = Cura.ProfilesModel.getItem(index).layer_height_without_unit - var result = Cura.ProfilesModel.getItem(index).layer_height_without_unit - - if(result == undefined) + if (result == undefined) result = "" } return result From b20c6c6ac7a123c7da0b1c486e3af87a27f6391f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 Jan 2018 13:02:00 +0100 Subject: [PATCH 46/49] Use isinstance instead of type checking for SceneNode isinstance also checks for subclasses. In our case, SceneNode was just extended to CuraSceneNode so this test was failing. Contributes to issue CURA-4766. --- cura/Settings/ExtruderManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index 32e3867300..351843ae14 100755 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -270,7 +270,7 @@ class ExtruderManager(QObject): return [] # Get the extruders of all printable meshes in the scene - meshes = [node for node in DepthFirstIterator(scene_root) if type(node) is SceneNode and node.isSelectable()] + meshes = [node for node in DepthFirstIterator(scene_root) if isinstance(node, SceneNode) and node.isSelectable()] for mesh in meshes: extruder_stack_id = mesh.callDecoration("getActiveExtruder") if not extruder_stack_id: From fefb20deb786d94ca807e6011ea9ca21d62bca46 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 Jan 2018 13:33:40 +0100 Subject: [PATCH 47/49] Don't start slicing again if you can't slice Contributes to issue CURA-4766. --- plugins/CuraEngineBackend/CuraEngineBackend.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 74dd515951..ff6c196c2d 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -204,7 +204,6 @@ class CuraEngineBackend(QObject, Backend): if self._process_layers_job: Logger.log("d", " ## Process layers job still busy, trying later") - self._invokeSlice() return # see if we really have to slice @@ -214,7 +213,6 @@ class CuraEngineBackend(QObject, Backend): num_objects = self._numObjects() if build_plate_to_be_sliced not in num_objects or num_objects[build_plate_to_be_sliced] == 0: Logger.log("d", "Build plate %s has 0 objects to be sliced, skipping", build_plate_to_be_sliced) - self._invokeSlice() return self._stored_layer_data = [] From a8ad956c927df2eaa4140ee88eacb69851bd07f8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 Jan 2018 13:34:39 +0100 Subject: [PATCH 48/49] Erase gcode of build plates that are determined to be empty You don't want to start a new slice, but you should still erase the g-code there. Contributes to issue CURA-4525. --- plugins/CuraEngineBackend/CuraEngineBackend.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index ff6c196c2d..4491008997 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -206,12 +206,16 @@ class CuraEngineBackend(QObject, Backend): Logger.log("d", " ## Process layers job still busy, trying later") return + if not hasattr(self._scene, "gcode_list"): + self._scene.gcode_list = {} + # see if we really have to slice active_build_plate = Application.getInstance().getBuildPlateModel().activeBuildPlate build_plate_to_be_sliced = self._build_plates_to_be_sliced.pop(0) Logger.log("d", "Going to slice build plate [%s]!" % build_plate_to_be_sliced) num_objects = self._numObjects() if build_plate_to_be_sliced not in num_objects or num_objects[build_plate_to_be_sliced] == 0: + self._scene.gcode_list[build_plate_to_be_sliced] = [] Logger.log("d", "Build plate %s has 0 objects to be sliced, skipping", build_plate_to_be_sliced) return @@ -229,8 +233,6 @@ class CuraEngineBackend(QObject, Backend): self.processingProgress.emit(0.0) self.backendStateChange.emit(BackendState.NotStarted) - if not hasattr(self._scene, "gcode_list"): - self._scene.gcode_list = {} self._scene.gcode_list[build_plate_to_be_sliced] = [] #[] indexed by build plate number self._slicing = True self.slicingStarted.emit() From a717960695bb35789e166ab1d6281d317bef50ff Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 5 Jan 2018 13:46:05 +0100 Subject: [PATCH 49/49] Disallow negative branch angles The engine can't really handle that any more. Contributes to issue CURA-4523. --- 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 e3a1c0892a..6eef6b1e9b 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3854,12 +3854,11 @@ "support_tree_branch_diameter_angle": { "label": "Tree Support Branch Diameter Angle", - "description": "The angle of the branches' diameter as they gradually become thicker towards the bottom. An angle of 0 will cause the branches to have uniform thickness over their length. A negative angle makes them thinner towards the bottom, so be careful as they might disappear. A small positive angle can increase stability of the tree support.", + "description": "The angle of the branches' diameter as they gradually become thicker towards the bottom. An angle of 0 will cause the branches to have uniform thickness over their length. A bit of an angle can increase stability of the tree support.", "unit": "°", "type": "float", - "minimum_value": "-89.9999", + "minimum_value": "0", "maximum_value": "89.9999", - "minimum_value_warning": "0", "maximum_value_warning": "15", "default_value": 5, "limit_to_extruder": "support_infill_extruder_nr",