Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben D <rubend@tutanota.com>2018-03-22 03:38:34 +0300
committerRuben D <rubend@tutanota.com>2018-03-22 03:38:34 +0300
commit329a0b121d8831c47f730c8db72d5654b90d4a74 (patch)
tree212080feeb222241b5d7b497804f89b5fd34774f /plugins/ModelChecker
parent25e7cb457d400aac0fc2308692401d131bfa8957 (diff)
Move shrinkage parameters into shrinkage function
So that they are closer to where they are relevant if we're going to have more checks in this class. Contributes to issue CURA-4557.
Diffstat (limited to 'plugins/ModelChecker')
-rw-r--r--plugins/ModelChecker/ModelChecker.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/ModelChecker/ModelChecker.py b/plugins/ModelChecker/ModelChecker.py
index 8e27171d68..5f3f7a8430 100644
--- a/plugins/ModelChecker/ModelChecker.py
+++ b/plugins/ModelChecker/ModelChecker.py
@@ -16,11 +16,6 @@ from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
catalog = i18nCatalog("cura")
-SHRINKAGE_THRESHOLD = 0.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.
-
-
class ModelChecker(QObject, Extension):
## Signal that gets emitted when anything changed that we need to check.
onChanged = pyqtSignal()
@@ -51,6 +46,10 @@ 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.
+ 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.
+
material_shrinkage = self.getMaterialShrinkage()
warning_nodes = []
@@ -58,9 +57,9 @@ class ModelChecker(QObject, Extension):
# Check node material shrinkage and bounding box size
for node in self.sliceableNodes():
node_extruder_position = node.callDecoration("getActiveExtruderPosition")
- if material_shrinkage[node_extruder_position] > SHRINKAGE_THRESHOLD:
+ if material_shrinkage[node_extruder_position] > shrinkage_threshold:
bbox = node.getBoundingBox()
- if bbox.width >= WARNING_SIZE_XY or bbox.depth >= WARNING_SIZE_XY or bbox.height >= WARNING_SIZE_Z:
+ if bbox.width >= warning_size_xy or bbox.depth >= warning_size_xy or bbox.height >= warning_size_z:
warning_nodes.append(node)
return warning_nodes