diff options
author | Jaime van Kessel <nallath@gmail.com> | 2020-11-25 17:42:15 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2020-11-25 17:42:15 +0300 |
commit | 99c12de6b08604802bf121c405295d29cb9d66e6 (patch) | |
tree | 012aaa50d416c2c1349cda4b36532c746bf94bf8 /plugins/ModelChecker | |
parent | 09066f2744cd11852131b6678b2e141713c72deb (diff) | |
parent | 39acad87d916b32c98e852b9e14b6b76b0070852 (diff) |
Merge branch 'master' of github.com:Ultimaker/Cura into fix_grouping_below_build_plate
Diffstat (limited to 'plugins/ModelChecker')
-rw-r--r-- | plugins/ModelChecker/ModelChecker.py | 18 | ||||
-rw-r--r-- | plugins/ModelChecker/plugin.json | 2 |
2 files changed, 6 insertions, 14 deletions
diff --git a/plugins/ModelChecker/ModelChecker.py b/plugins/ModelChecker/ModelChecker.py index b482667976..4f2f8bdf40 100644 --- a/plugins/ModelChecker/ModelChecker.py +++ b/plugins/ModelChecker/ModelChecker.py @@ -58,7 +58,7 @@ class ModelChecker(QObject, Extension): self._createView() def checkObjectsForShrinkage(self): - shrinkage_threshold = 0.5 #From what shrinkage percentage a warning will be issued about the model size. + shrinkage_threshold = 100.5 #From what shrinkage percentage a warning will be issued about the model size. warning_size_xy = 150 #The horizontal size of a model that would be too large when dealing with shrinking materials. warning_size_z = 100 #The vertical size of a model that would be too large when dealing with shrinking materials. @@ -86,7 +86,7 @@ class ModelChecker(QObject, Extension): Application.getInstance().callLater(lambda: self.onChanged.emit()) return False - if material_shrinkage[node_extruder_position] > shrinkage_threshold: + if material_shrinkage > shrinkage_threshold: bbox = node.getBoundingBox() if bbox is not None and (bbox.width >= warning_size_xy or bbox.depth >= warning_size_xy or bbox.height >= warning_size_z): warning_nodes.append(node) @@ -134,16 +134,8 @@ class ModelChecker(QObject, Extension): def showWarnings(self): self._caution_message.show() - def _getMaterialShrinkage(self): + def _getMaterialShrinkage(self) -> float: global_container_stack = Application.getInstance().getGlobalContainerStack() if global_container_stack is None: - return {} - - material_shrinkage = {} - # Get all shrinkage values of materials used - for extruder_position, extruder in enumerate(global_container_stack.extruderList): - shrinkage = extruder.material.getProperty("material_shrinkage_percentage", "value") - if shrinkage is None: - shrinkage = 0 - material_shrinkage[str(extruder_position)] = shrinkage - return material_shrinkage + return 100 + return global_container_stack.getProperty("material_shrinkage_percentage", "value") diff --git a/plugins/ModelChecker/plugin.json b/plugins/ModelChecker/plugin.json index 1e0e9be3af..664d7c1b9f 100644 --- a/plugins/ModelChecker/plugin.json +++ b/plugins/ModelChecker/plugin.json @@ -2,7 +2,7 @@ "name": "Model Checker", "author": "Ultimaker B.V.", "version": "1.0.1", - "api": "7.3.0", + "api": "7.4.0", "description": "Checks models and print configuration for possible printing issues and give suggestions.", "i18n-catalog": "cura" } |