mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
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:
parent
18d67dc552
commit
622233bfd8
1 changed files with 1 additions and 12 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue