chiark / gitweb /
Fix the bug of loading very small objects.
authordaid <daid303@gmail.com>
Sat, 28 Dec 2013 13:18:13 +0000 (14:18 +0100)
committerdaid <daid303@gmail.com>
Sat, 28 Dec 2013 13:18:13 +0000 (14:18 +0100)
Cura/util/polygon.py

index 1eba59e951381da473a3e29b068e8386f3e8b758..8772139f54eb28a52f515a65151c263a7e7a56ae 100644 (file)
@@ -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]]