From: daid Date: Sat, 28 Dec 2013 13:18:13 +0000 (+0100) Subject: Fix the bug of loading very small objects. X-Git-Tag: 14.01~14 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d45c0aaec15c4baf9e903e9fe3402d1c55d36cc5;p=cura.git Fix the bug of loading very small objects. --- diff --git a/Cura/util/polygon.py b/Cura/util/polygon.py index 1eba59e9..8772139f 100644 --- a/Cura/util/polygon.py +++ b/Cura/util/polygon.py @@ -18,8 +18,10 @@ def convexHull(pointList): points = unique.keys() points.sort() + if len(points) < 1: + return numpy.zeros((0, 2), numpy.float32) if len(points) < 2: - return numpy.array([], numpy.float32) + return numpy.array(points, numpy.float32) # Build upper half of the hull. upper = [points[0], points[1]]