From bc0ac0f2a06467963f776dda13c723ddb7314c3d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 2 Sep 2020 02:10:19 +0200 Subject: [PATCH] Only scale convex hull if there is a non-1 scaling factor This will save some processing power for the very common case where there is no scaling factor. Contributes to issue CURA-7118. --- cura/Scene/ConvexHullDecorator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cura/Scene/ConvexHullDecorator.py b/cura/Scene/ConvexHullDecorator.py index c86612bd71..5a47514f1e 100644 --- a/cura/Scene/ConvexHullDecorator.py +++ b/cura/Scene/ConvexHullDecorator.py @@ -381,8 +381,11 @@ class ConvexHullDecorator(SceneNodeDecorator): """ scale_factor = self._global_stack.getProperty("material_shrinkage_percentage", "value") / 100.0 - center = self.getNode().getBoundingBox().center - result = convex_hull.scale(scale_factor, [center.x, center.z]) # Yes, use Z instead of Y. Mixed conventions there with how the OpenGL coordinates are transmitted. + if scale_factor != 1.0: + center = self.getNode().getBoundingBox().center + result = convex_hull.scale(scale_factor, [center.x, center.z]) # Yes, use Z instead of Y. Mixed conventions there with how the OpenGL coordinates are transmitted. + else: + result = convex_hull horizontal_expansion = max( self._getSettingProperty("xy_offset", "value"),