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.
This commit is contained in:
Ghostkeeper 2016-09-28 10:36:19 +02:00
parent 18d67dc552
commit 622233bfd8
No known key found for this signature in database
GPG key ID: 701948C5954A7385

View file

@ -252,18 +252,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
# adjust head_and_fans with extra margin # adjust head_and_fans with extra margin
if extra_margin > 0: if extra_margin > 0:
# In Cura 2.2+, there is a function to create this circle-like polygon. extra_margin_polygon = Polygon.approximatedCircle(extra_margin)
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))
poly = poly.getMinkowskiHull(extra_margin_polygon) poly = poly.getMinkowskiHull(extra_margin_polygon)
return poly return poly