From 622233bfd87b20dd1b203547ca8c7f0ff85161b7 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 28 Sep 2016 10:36:19 +0200 Subject: [PATCH] Remove duplicate code for creating circle approximations This code is now in the Polygon class, so we can re-use it. Contributes to issue CURA-2407. --- cura/ConvexHullDecorator.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/cura/ConvexHullDecorator.py b/cura/ConvexHullDecorator.py index d1f3f07c4b..15dd9208e6 100644 --- a/cura/ConvexHullDecorator.py +++ b/cura/ConvexHullDecorator.py @@ -252,18 +252,7 @@ class ConvexHullDecorator(SceneNodeDecorator): # adjust head_and_fans with extra margin if extra_margin > 0: - # In Cura 2.2+, there is a function to create this circle-like polygon. - extra_margin_polygon = Polygon(numpy.array([ - [-extra_margin, 0], - [-extra_margin * 0.707, extra_margin * 0.707], - [0, extra_margin], - [extra_margin * 0.707, extra_margin * 0.707], - [extra_margin, 0], - [extra_margin * 0.707, -extra_margin * 0.707], - [0, -extra_margin], - [-extra_margin * 0.707, -extra_margin * 0.707] - ], numpy.float32)) - + extra_margin_polygon = Polygon.approximatedCircle(extra_margin) poly = poly.getMinkowskiHull(extra_margin_polygon) return poly