diff options
author | Tim Kuipers <t.kuipers@ultimaker.com> | 2017-03-13 19:19:29 +0300 |
---|---|---|
committer | Tim Kuipers <t.kuipers@ultimaker.com> | 2017-03-13 19:19:29 +0300 |
commit | 914aa89711bde3eede586dbcad11879ba28fdab3 (patch) | |
tree | 9c0082673bced386a03ecd270db883442bcba30b /cura/ConvexHullDecorator.py | |
parent | d7e35fa480d436e15102bac51e719e6cba5ce774 (diff) |
feat: model to mold (CURA-3512)
Diffstat (limited to 'cura/ConvexHullDecorator.py')
-rw-r--r-- | cura/ConvexHullDecorator.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cura/ConvexHullDecorator.py b/cura/ConvexHullDecorator.py index 7065b71735..da72ffdbe3 100644 --- a/cura/ConvexHullDecorator.py +++ b/cura/ConvexHullDecorator.py @@ -258,12 +258,16 @@ class ConvexHullDecorator(SceneNodeDecorator): # influences the collision area. def _offsetHull(self, convex_hull): horizontal_expansion = self._getSettingProperty("xy_offset", "value") - if horizontal_expansion != 0: + mold_width = 0 + if self._getSettingProperty("mold_enabled", "value"): + mold_width = self._getSettingProperty("mold_width", "value") + hull_offset = horizontal_expansion + mold_width + if hull_offset != 0: expansion_polygon = Polygon(numpy.array([ - [-horizontal_expansion, -horizontal_expansion], - [-horizontal_expansion, horizontal_expansion], - [horizontal_expansion, horizontal_expansion], - [horizontal_expansion, -horizontal_expansion] + [-hull_offset, -hull_offset], + [-hull_offset, hull_offset], + [hull_offset, hull_offset], + [hull_offset, -hull_offset] ], numpy.float32)) return convex_hull.getMinkowskiHull(expansion_polygon) else: @@ -331,4 +335,4 @@ class ConvexHullDecorator(SceneNodeDecorator): ## Settings that change the convex hull. # # If these settings change, the convex hull should be recalculated. - _influencing_settings = {"xy_offset"}
\ No newline at end of file + _influencing_settings = {"xy_offset", "mold_enabled", "mold_width"}
\ No newline at end of file |