From c5371e19ccbaace7684d93f7f35c1aae40537fb2 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Fri, 12 Oct 2018 14:07:13 +0200 Subject: [PATCH 01/16] fix: initial layer line width factor is not a specialization of the line width any more They are not even in the same unit, so it cannot be a child. A parent setting should be exactly equal to all child settings combined. --- resources/definitions/fdmprinter.def.json | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 138e1adcc5..5ca4fc78bb 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -961,20 +961,20 @@ "maximum_value_warning": "2 * machine_nozzle_size", "settable_per_mesh": false, "settable_per_extruder": true - }, - "initial_layer_line_width_factor": - { - "label": "Initial Layer Line Width", - "description": "Multiplier of the line width on the first layer. Increasing this could improve bed adhesion.", - "type": "float", - "unit": "%", - "default_value": 100.0, - "minimum_value": "0.001", - "maximum_value_warning": "150", - "settable_per_mesh": false, - "settable_per_extruder": true } } + }, + "initial_layer_line_width_factor": + { + "label": "Initial Layer Line Width", + "description": "Multiplier of the line width on the first layer. Increasing this could improve bed adhesion.", + "type": "float", + "unit": "%", + "default_value": 100.0, + "minimum_value": "0.001", + "maximum_value_warning": "150", + "settable_per_mesh": false, + "settable_per_extruder": true } } }, From 3d1ad32c57a60a958e7208033215600b10ff15a4 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Fri, 12 Oct 2018 15:54:02 +0200 Subject: [PATCH 02/16] feat: feature dependent flow settings --- resources/definitions/fdmprinter.def.json | 175 +++++++++++++++++++++- 1 file changed, 174 insertions(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 5ca4fc78bb..bac99d5c37 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2229,7 +2229,180 @@ "minimum_value_warning": "50", "maximum_value_warning": "150", "enabled": "machine_gcode_flavor != \"UltiGCode\"", - "settable_per_mesh": true + "settable_per_mesh": true, + "children": + { + "wall_material_flow": + { + "label": "Wall Flow", + "description": "Flow compensation on wall lines.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "flow", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "limit_to_extruder": "wall_0_extruder_nr if wall_x_extruder_nr == wall_0_extruder_nr else -1", + "settable_per_mesh": true, + "children": + { + "wall_0_material_flow": + { + "label": "Outer Wall Flow", + "description": "Flow compensation on the outermost wall line.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "wall_material_flow", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "limit_to_extruder": "wall_0_extruder_nr", + "settable_per_mesh": true + }, + "wall_x_material_flow": + { + "label": "Inner Wall(s) Flow", + "description": "Flow compensation on wall lines for all wall lines except the outermost one.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "wall_material_flow", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "limit_to_extruder": "wall_x_extruder_nr", + "settable_per_mesh": true + } + } + }, + "skin_material_flow": + { + "label": "Top/Bottom Flow", + "description": "Flow compensation on top/bottom lines.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "flow", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "enabled": "top_layers > 0 or bottom_layers > 0", + "limit_to_extruder": "top_bottom_extruder_nr", + "settable_per_mesh": true + }, + "roofing_material_flow": + { + "label": "Top Surface Skin Flow", + "description": "Flow compensation on lines of the areas at the top of the print.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "skin_material_flow", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "limit_to_extruder": "roofing_extruder_nr", + "settable_per_mesh": true, + "enabled": "roofing_layer_count > 0 and top_layers > 0" + }, + "infill_material_flow": + { + "label": "Infill Flow", + "description": "Flow compensation on infill lines.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "flow", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "enabled": "infill_sparse_density > 0", + "limit_to_extruder": "infill_extruder_nr", + "settable_per_mesh": true + }, + "skirt_brim_material_flow": + { + "label": "Skirt/Brim Flow", + "description": "Flow compensation on skirt or brim lines.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "flow", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "enabled": "resolveOrValue('adhesion_type') == 'skirt' or resolveOrValue('adhesion_type') == 'brim'", + "settable_per_mesh": false, + "settable_per_extruder": true + }, + "support_material_flow": + { + "label": "Support Flow", + "description": "Flow compensation on support structure lines.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "flow", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "limit_to_extruder": "support_infill_extruder_nr", + "settable_per_mesh": false, + "settable_per_extruder": true + }, + "support_interface_material_flow": + { + "label": "Support Interface Flow", + "description": "Flow compensation on lines of support roof or floor.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "flow", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "enabled": "support_enable and support_interface_enable", + "limit_to_extruder": "support_interface_extruder_nr", + "settable_per_mesh": false, + "settable_per_extruder": true, + "children": + { + "support_roof_material_flow": + { + "label": "Support Roof Flow", + "description": "Flow compensation on support roof lines.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "extruderValue(support_roof_extruder_nr, 'support_interface_material_flow')", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "enabled": "support_enable and support_roof_enable", + "limit_to_extruder": "support_roof_extruder_nr", + "settable_per_mesh": false, + "settable_per_extruder": true + }, + "support_bottom_material_flow": + { + "label": "Support Floor Flow", + "description": "Flow compensation on support floor lines.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "extruderValue(support_bottom_extruder_nr, 'support_interface_material_flow')", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "enabled": "support_enable and support_bottom_enable", + "limit_to_extruder": "support_bottom_extruder_nr", + "settable_per_mesh": false, + "settable_per_extruder": true + } + } + } }, "material_flow_layer_0": { From d5db639c45a41eb5bcd2aca1060694da0b7e34d2 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Fri, 12 Oct 2018 15:54:34 +0200 Subject: [PATCH 03/16] move prime_tower_flow to rest of flow settings --- resources/definitions/fdmprinter.def.json | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index bac99d5c37..07f16b5cc2 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2402,7 +2402,22 @@ "settable_per_extruder": true } } + }, + "prime_tower_material_flow": + { + "label": "Prime Tower Flow", + "description": "Flow compensation on prime tower lines.", + "unit": "%", + "type": "float", + "default_value": 100, + "value": "flow", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "settable_per_mesh": false, + "settable_per_extruder": true } + } }, "material_flow_layer_0": { @@ -5363,21 +5378,6 @@ "settable_per_mesh": false, "settable_per_extruder": false }, - "prime_tower_flow": - { - "label": "Prime Tower Flow", - "description": "Flow compensation: the amount of material extruded is multiplied by this value.", - "type": "float", - "unit": "%", - "enabled": "resolveOrValue('prime_tower_enable')", - "default_value": 100, - "value": "material_flow", - "minimum_value": "0.0001", - "minimum_value_warning": "50", - "maximum_value_warning": "150", - "settable_per_mesh": false, - "settable_per_extruder": true - }, "prime_tower_wipe_enabled": { "label": "Wipe Inactive Nozzle on Prime Tower", From 46bb322d0b407a8bc51c53fec9c226933390e675 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Fri, 12 Oct 2018 15:56:13 +0200 Subject: [PATCH 04/16] initial layer flow is now a multiplier on top of the material_flow that's because we should override the per-feature flow settings with one global material_flow_layer_0 setting to rule them all. The flow per feature is more accurate to these features, so the initial layer should expand all these seaprately. --- resources/definitions/fdmprinter.def.json | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 07f16b5cc2..36363afb5d 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2425,7 +2425,6 @@ "description": "Flow compensation for the first layer: the amount of material extruded on the initial layer is multiplied by this value.", "unit": "%", "default_value": 100, - "value": "material_flow", "type": "float", "minimum_value": "0.0001", "minimum_value_warning": "50", From 3da558245fc7068bee9383a0ae6090f74f8e1ffd Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Fri, 12 Oct 2018 16:11:54 +0200 Subject: [PATCH 05/16] fix setting inheritance from material_flow --- resources/definitions/fdmprinter.def.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 36363afb5d..73fe8086c9 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2239,7 +2239,7 @@ "unit": "%", "type": "float", "default_value": 100, - "value": "flow", + "value": "material_flow", "minimum_value": "5", "minimum_value_warning": "50", "maximum_value_warning": "150", @@ -2284,7 +2284,7 @@ "unit": "%", "type": "float", "default_value": 100, - "value": "flow", + "value": "material_flow", "minimum_value": "5", "minimum_value_warning": "50", "maximum_value_warning": "150", @@ -2314,7 +2314,7 @@ "unit": "%", "type": "float", "default_value": 100, - "value": "flow", + "value": "material_flow", "minimum_value": "5", "minimum_value_warning": "50", "maximum_value_warning": "150", @@ -2329,7 +2329,7 @@ "unit": "%", "type": "float", "default_value": 100, - "value": "flow", + "value": "material_flow", "minimum_value": "5", "minimum_value_warning": "50", "maximum_value_warning": "150", @@ -2344,7 +2344,7 @@ "unit": "%", "type": "float", "default_value": 100, - "value": "flow", + "value": "material_flow", "minimum_value": "5", "minimum_value_warning": "50", "maximum_value_warning": "150", @@ -2359,7 +2359,7 @@ "unit": "%", "type": "float", "default_value": 100, - "value": "flow", + "value": "material_flow", "minimum_value": "5", "minimum_value_warning": "50", "maximum_value_warning": "150", @@ -2410,7 +2410,7 @@ "unit": "%", "type": "float", "default_value": 100, - "value": "flow", + "value": "material_flow", "minimum_value": "5", "minimum_value_warning": "50", "maximum_value_warning": "150", From 369994113b043e11ea91f943c5c7fa3a1ebcc7e4 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Fri, 12 Oct 2018 16:12:13 +0200 Subject: [PATCH 06/16] keep old name of prime_tower_flow --- 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 73fe8086c9..3169aa4e6b 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2403,7 +2403,7 @@ } } }, - "prime_tower_material_flow": + "prime_tower_flow": { "label": "Prime Tower Flow", "description": "Flow compensation on prime tower lines.", From 59c39c0f5f73d992a8115d5c9790be690132073a Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Wed, 17 Oct 2018 14:30:30 +0200 Subject: [PATCH 07/16] move setting prime_tower_flow also in default expert visibility --- resources/setting_visibility/expert.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/setting_visibility/expert.cfg b/resources/setting_visibility/expert.cfg index 437790ef74..5e5a389ff9 100644 --- a/resources/setting_visibility/expert.cfg +++ b/resources/setting_visibility/expert.cfg @@ -113,6 +113,7 @@ material_bed_temperature_layer_0 material_adhesion_tendency material_surface_energy material_flow +prime_tower_flow material_flow_layer_0 retraction_enable retract_at_layer_change @@ -295,7 +296,6 @@ prime_tower_size prime_tower_min_volume prime_tower_position_x prime_tower_position_y -prime_tower_flow prime_tower_wipe_enabled ooze_shield_enabled ooze_shield_angle From 0b7b395db1ca1de962d57ee6766ec1930ce3600f Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Wed, 17 Oct 2018 14:30:59 +0200 Subject: [PATCH 08/16] have all flow settings in expert visibility --- resources/setting_visibility/expert.cfg | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/resources/setting_visibility/expert.cfg b/resources/setting_visibility/expert.cfg index 5e5a389ff9..5fa2ec1ff2 100644 --- a/resources/setting_visibility/expert.cfg +++ b/resources/setting_visibility/expert.cfg @@ -113,6 +113,17 @@ material_bed_temperature_layer_0 material_adhesion_tendency material_surface_energy material_flow +wall_material_flow +wall_0_material_flow +wall_x_material_flow +skin_material_flow +roofing_material_flow +infill_material_flow +skirt_brim_material_flow +support_material_flow +support_interface_material_flow +support_roof_material_flow +support_bottom_material_flow prime_tower_flow material_flow_layer_0 retraction_enable From db3d6aae83b2a6123d59de1e0a25210a948b3432 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 1 Jul 2019 09:55:04 +0200 Subject: [PATCH 09/16] Add boundingbox test for buildvolume --- tests/TestBuildVolume.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/TestBuildVolume.py b/tests/TestBuildVolume.py index 902d8a839c..6ccb3d0fb7 100644 --- a/tests/TestBuildVolume.py +++ b/tests/TestBuildVolume.py @@ -1,9 +1,9 @@ from unittest.mock import MagicMock, patch - +from UM.Math.AxisAlignedBox import AxisAlignedBox import pytest from UM.Math.Polygon import Polygon -from UM.Settings.SettingInstance import InstanceState +from UM.Math.Vector import Vector from cura.BuildVolume import BuildVolume, PRIME_CLEARANCE import numpy @@ -304,6 +304,25 @@ class TestRebuild: build_volume.rebuild() assert build_volume.getMeshData() is None + def test_updateBoundingBox(self, build_volume: BuildVolume): + build_volume.setWidth(10) + build_volume.setHeight(10) + build_volume.setDepth(10) + + mocked_global_stack = MagicMock() + build_volume._global_container_stack = mocked_global_stack + build_volume.getEdgeDisallowedSize = MagicMock(return_value = 0) + build_volume.updateNodeBoundaryCheck = MagicMock() + + # Fake the the "engine is created callback" + build_volume._onEngineCreated() + build_volume.rebuild() + + bounding_box = build_volume.getBoundingBox() + assert bounding_box.minimum == Vector(-5.0, -1.0, -5.0) + assert bounding_box.maximum == Vector(5.0, 10.0, 5.0) + + class TestUpdateMachineSizeProperties: setting_property_dict = {"machine_width": {"value": 50}, "machine_depth": {"value": 100}, From f86cf06b8845c74922592adc9149948f74624954 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 1 Jul 2019 10:56:50 +0200 Subject: [PATCH 10/16] Add typing --- cura/Arranging/ShapeArray.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/cura/Arranging/ShapeArray.py b/cura/Arranging/ShapeArray.py index 64b78d6f17..8a8cc7ad18 100644 --- a/cura/Arranging/ShapeArray.py +++ b/cura/Arranging/ShapeArray.py @@ -1,12 +1,18 @@ +#Copyright (c) 2019 Ultimaker B.V. +#Cura is released under the terms of the LGPLv3 or higher. + import numpy import copy +from typing import Optional, Tuple, TYPE_CHECKING from UM.Math.Polygon import Polygon +if TYPE_CHECKING: + from UM.Scene.SceneNode import SceneNode ## Polygon representation as an array for use with Arrange class ShapeArray: - def __init__(self, arr, offset_x, offset_y, scale = 1): + def __init__(self, arr: numpy.array, offset_x: float, offset_y: float, scale: float = 1) -> None: self.arr = arr self.offset_x = offset_x self.offset_y = offset_y @@ -16,7 +22,7 @@ class ShapeArray: # \param vertices # \param scale scale the coordinates @classmethod - def fromPolygon(cls, vertices, scale = 1): + def fromPolygon(cls, vertices: numpy.array, scale: float = 1) -> "ShapeArray": # scale vertices = vertices * scale # flip y, x -> x, y @@ -42,7 +48,7 @@ class ShapeArray: # \param min_offset offset for the offset ShapeArray # \param scale scale the coordinates @classmethod - def fromNode(cls, node, min_offset, scale = 0.5, include_children = False): + def fromNode(cls, node: SceneNode, min_offset: float, scale: float = 0.5, include_children: bool = False) -> Tuple[Optional["ShapeArray"], Optional["ShapeArray"]]: transform = node._transformation transform_x = transform._data[0][3] transform_y = transform._data[2][3] @@ -88,7 +94,7 @@ class ShapeArray: # \param shape numpy format shape, [x-size, y-size] # \param vertices @classmethod - def arrayFromPolygon(cls, shape, vertices): + def arrayFromPolygon(cls, shape: Tuple[int, int], vertices: numpy.array) -> numpy.array: base_array = numpy.zeros(shape, dtype = numpy.int32) # Initialize your array of zeros fill = numpy.ones(base_array.shape) * True # Initialize boolean array defining shape fill @@ -111,9 +117,9 @@ class ShapeArray: # \param p2 2-tuple with x, y for point 2 # \param base_array boolean array to project the line on @classmethod - def _check(cls, p1, p2, base_array): + def _check(cls, p1: numpy.array, p2: numpy.array, base_array: numpy.array) -> bool: if p1[0] == p2[0] and p1[1] == p2[1]: - return + return False idxs = numpy.indices(base_array.shape) # Create 3D array of indices p1 = p1.astype(float) @@ -131,5 +137,4 @@ class ShapeArray: max_col_idx = (idxs[0] - p1[0]) / (p2[0] - p1[0]) * (p2[1] - p1[1]) + p1[1] sign = numpy.sign(p2[0] - p1[0]) - return idxs[1] * sign <= max_col_idx * sign - + return idxs[1] * sign <= max_col_idx * sign \ No newline at end of file From 17e86a28b77e1031199c25002b32a6458b319d49 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 1 Jul 2019 10:58:08 +0200 Subject: [PATCH 11/16] Guard against broken import --- cura/Arranging/ShapeArray.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Arranging/ShapeArray.py b/cura/Arranging/ShapeArray.py index 8a8cc7ad18..9227e446fb 100644 --- a/cura/Arranging/ShapeArray.py +++ b/cura/Arranging/ShapeArray.py @@ -48,7 +48,7 @@ class ShapeArray: # \param min_offset offset for the offset ShapeArray # \param scale scale the coordinates @classmethod - def fromNode(cls, node: SceneNode, min_offset: float, scale: float = 0.5, include_children: bool = False) -> Tuple[Optional["ShapeArray"], Optional["ShapeArray"]]: + def fromNode(cls, node: "SceneNode", min_offset: float, scale: float = 0.5, include_children: bool = False) -> Tuple[Optional["ShapeArray"], Optional["ShapeArray"]]: transform = node._transformation transform_x = transform._data[0][3] transform_y = transform._data[2][3] From 6544c123a480ac851e50fc10a7155d346a698c0f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 1 Jul 2019 11:15:26 +0200 Subject: [PATCH 12/16] Add camera view selector to the view application menu --- resources/qml/Menus/ViewMenu.qml | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/resources/qml/Menus/ViewMenu.qml b/resources/qml/Menus/ViewMenu.qml index 59e6dd24d0..4e5545223f 100644 --- a/resources/qml/Menus/ViewMenu.qml +++ b/resources/qml/Menus/ViewMenu.qml @@ -24,6 +24,51 @@ Menu MenuItem { action: Cura.Actions.viewRightSideCamera; } } + Menu + { + id: cameraViewMenu + property string cameraMode: UM.Preferences.getValue("general/camera_perspective_mode") + Connections + { + target: UM.Preferences + onPreferenceChanged: + { + if (preference !== "general/camera_perspective_mode") + { + return + } + cameraViewMenu.cameraMode = UM.Preferences.getValue("general/camera_perspective_mode") + } + } + + title: catalog.i18nc("@action:inmenu menubar:view","Camera view") + MenuItem + { + text: catalog.i18nc("@action:inmenu menubar:view", "Perspective") + checkable: true + checked: cameraViewMenu.cameraMode == "perspective" + onTriggered: + { + UM.Preferences.setValue("general/camera_perspective_mode", "perspective") + checked = cameraViewMenu.cameraMode == "perspective" + } + exclusiveGroup: group + } + MenuItem + { + text: catalog.i18nc("@action:inmenu menubar:view", "Orthographic") + checkable: true + checked: cameraViewMenu.cameraMode == "orthogonal" + onTriggered: + { + UM.Preferences.setValue("general/camera_perspective_mode", "orthogonal") + checked = cameraViewMenu.cameraMode == "orthogonal" + } + exclusiveGroup: group + } + ExclusiveGroup { id: group } + } + MenuSeparator { visible: UM.Preferences.getValue("cura/use_multi_build_plate") From a7d419f497203757c7eee7e4f5f7e6dfe5c4f1af Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 1 Jul 2019 11:18:54 +0200 Subject: [PATCH 13/16] Fix deprecation decorator breaking the getExtruder function --- cura/Settings/MachineManager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 3366d67d25..764ad8ed43 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -986,8 +986,9 @@ class MachineManager(QObject): self._application.globalContainerStackChanged.emit() self.forceUpdateAllSettings() + # Note that this function is deprecated, but the decorators for this don't play well together! + # @deprecated("use Cura.MachineManager.activeMachine.extruders instead", "4.2") @pyqtSlot(int, result = QObject) - @deprecated("use Cura.MachineManager.activeMachine.extruders instead", "4.2") def getExtruder(self, position: int) -> Optional[ExtruderStack]: if self._global_container_stack: return self._global_container_stack.extruders.get(str(position)) From ea93490c45249c8c29f3f0916326e4e8b35f5ae2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 1 Jul 2019 14:55:46 +0200 Subject: [PATCH 14/16] Fix crash when loading multi-extrusion print Because getProperty needs a property to get. --- cura/BuildVolume.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 3358fe8b85..559cb72e3d 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -791,7 +791,7 @@ class BuildVolume(SceneNode): result[extruder.getId()] = [] # Currently, the only normally printed object is the prime tower. - if self._global_container_stack.getProperty("prime_tower_enable"): + if self._global_container_stack.getProperty("prime_tower_enable", "value"): prime_tower_size = self._global_container_stack.getProperty("prime_tower_size", "value") machine_width = self._global_container_stack.getProperty("machine_width", "value") machine_depth = self._global_container_stack.getProperty("machine_depth", "value") From f5b0cae55451df8415599225456acd5604dfa072 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Tue, 2 Jul 2019 07:46:21 +0200 Subject: [PATCH 15/16] Prime-brim calculation needs adhesion extruder, not just any. --- cura/BuildVolume.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 3358fe8b85..bf38e6e562 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -787,11 +787,14 @@ class BuildVolume(SceneNode): # where that extruder may not print. def _computeDisallowedAreasPrinted(self, used_extruders): result = {} + adhesion_extruder = None #type: ExtruderStack for extruder in used_extruders: + if int(extruder.getProperty("extruder_nr", "value")) == int(self._global_container_stack.getProperty("adhesion_extruder_nr", "value")): + adhesion_extruder = extruder result[extruder.getId()] = [] # Currently, the only normally printed object is the prime tower. - if self._global_container_stack.getProperty("prime_tower_enable"): + if self._global_container_stack.getProperty("prime_tower_enable", "value"): prime_tower_size = self._global_container_stack.getProperty("prime_tower_size", "value") machine_width = self._global_container_stack.getProperty("machine_width", "value") machine_depth = self._global_container_stack.getProperty("machine_depth", "value") @@ -801,11 +804,11 @@ class BuildVolume(SceneNode): prime_tower_x = prime_tower_x - machine_width / 2 #Offset by half machine_width and _depth to put the origin in the front-left. prime_tower_y = prime_tower_y + machine_depth / 2 - if self._global_container_stack.getProperty("prime_tower_brim_enable", "value") and self._global_container_stack.getProperty("adhesion_type", "value") != "raft": + if adhesion_extruder is not None and self._global_container_stack.getProperty("prime_tower_brim_enable", "value") and self._global_container_stack.getProperty("adhesion_type", "value") != "raft": brim_size = ( - extruder.getProperty("brim_line_count", "value") * - extruder.getProperty("skirt_brim_line_width", "value") / 100.0 * - extruder.getProperty("initial_layer_line_width_factor", "value") + adhesion_extruder.getProperty("brim_line_count", "value") * + adhesion_extruder.getProperty("skirt_brim_line_width", "value") / 100.0 * + adhesion_extruder.getProperty("initial_layer_line_width_factor", "value") ) prime_tower_x -= brim_size prime_tower_y += brim_size From 43baca1545af9d1f242438378bec1f5c44df0207 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 2 Jul 2019 13:33:15 +0200 Subject: [PATCH 16/16] Hardcode Cura SDK version with each release --- CMakeLists.txt | 1 - cura/ApplicationMetadata.py | 8 +------- cura/CuraVersion.py.in | 4 +++- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba427a745d..4406fd4856 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,6 @@ set(CURA_APP_NAME "cura" CACHE STRING "Short name of Cura, used for configuratio set(CURA_APP_DISPLAY_NAME "Ultimaker Cura" CACHE STRING "Display name of Cura") set(CURA_VERSION "master" CACHE STRING "Version name of Cura") set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'") -set(CURA_SDK_VERSION "" CACHE STRING "SDK version of Cura") set(CURA_CLOUD_API_ROOT "" CACHE STRING "Alternative Cura cloud API root") set(CURA_CLOUD_API_VERSION "" CACHE STRING "Alternative Cura cloud API version") diff --git a/cura/ApplicationMetadata.py b/cura/ApplicationMetadata.py index 06fdd7a3f0..aea68c0af5 100644 --- a/cura/ApplicationMetadata.py +++ b/cura/ApplicationMetadata.py @@ -9,7 +9,6 @@ DEFAULT_CURA_DISPLAY_NAME = "Ultimaker Cura" DEFAULT_CURA_VERSION = "master" DEFAULT_CURA_BUILD_TYPE = "" DEFAULT_CURA_DEBUG_MODE = False -DEFAULT_CURA_SDK_VERSION = "6.1.0" try: from cura.CuraVersion import CuraAppName # type: ignore @@ -42,9 +41,4 @@ try: except ImportError: CuraDebugMode = DEFAULT_CURA_DEBUG_MODE -try: - from cura.CuraVersion import CuraSDKVersion # type: ignore - if CuraSDKVersion == "": - CuraSDKVersion = DEFAULT_CURA_SDK_VERSION -except ImportError: - CuraSDKVersion = DEFAULT_CURA_SDK_VERSION +from cura.CuraVersion import CuraSDKVersion # type: ignore diff --git a/cura/CuraVersion.py.in b/cura/CuraVersion.py.in index 1a500df248..abbc3a0a0d 100644 --- a/cura/CuraVersion.py.in +++ b/cura/CuraVersion.py.in @@ -6,7 +6,9 @@ CuraAppDisplayName = "@CURA_APP_DISPLAY_NAME@" CuraVersion = "@CURA_VERSION@" CuraBuildType = "@CURA_BUILDTYPE@" CuraDebugMode = True if "@_cura_debugmode@" == "ON" else False -CuraSDKVersion = "@CURA_SDK_VERSION@" + +CuraSDKVersion = "6.1.0" + CuraCloudAPIRoot = "@CURA_CLOUD_API_ROOT@" CuraCloudAPIVersion = "@CURA_CLOUD_API_VERSION@" CuraCloudAccountAPIRoot = "@CURA_CLOUD_ACCOUNT_API_ROOT@"