diff options
author | Ghostkeeper <rubend@tutanota.com> | 2017-03-07 14:47:13 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2017-03-07 14:47:13 +0300 |
commit | b25a6423df655e957c9ffed00b574b4f988d8e1b (patch) | |
tree | 0fa9e9fc1e8b2464410620d0254957aa8fa9e802 /cura/ConvexHullDecorator.py | |
parent | 0abf4550842ede93f2df11ceb7dca8a0d5c173e2 (diff) |
Don't offset hull if offset is 0
This might speed things up a bit.
Diffstat (limited to 'cura/ConvexHullDecorator.py')
-rw-r--r-- | cura/ConvexHullDecorator.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/cura/ConvexHullDecorator.py b/cura/ConvexHullDecorator.py index 0006f7ff6c..7065b71735 100644 --- a/cura/ConvexHullDecorator.py +++ b/cura/ConvexHullDecorator.py @@ -258,13 +258,16 @@ class ConvexHullDecorator(SceneNodeDecorator): # influences the collision area. def _offsetHull(self, convex_hull): horizontal_expansion = self._getSettingProperty("xy_offset", "value") - expansion_polygon = Polygon(numpy.array([ - [-horizontal_expansion, -horizontal_expansion], - [-horizontal_expansion, horizontal_expansion], - [horizontal_expansion, horizontal_expansion], - [horizontal_expansion, -horizontal_expansion] - ], numpy.float32)) - return convex_hull.getMinkowskiHull(expansion_polygon) + if horizontal_expansion != 0: + expansion_polygon = Polygon(numpy.array([ + [-horizontal_expansion, -horizontal_expansion], + [-horizontal_expansion, horizontal_expansion], + [horizontal_expansion, horizontal_expansion], + [horizontal_expansion, -horizontal_expansion] + ], numpy.float32)) + return convex_hull.getMinkowskiHull(expansion_polygon) + else: + return convex_hull def _onChanged(self, *args): self._raft_thickness = self._build_volume.getRaftThickness() |