diff --git a/cura/Arranging/ShapeArray.py b/cura/Arranging/ShapeArray.py index 6ef92b1743..68be9a6478 100644 --- a/cura/Arranging/ShapeArray.py +++ b/cura/Arranging/ShapeArray.py @@ -29,12 +29,10 @@ class ShapeArray: offset_x = int(numpy.amin(flip_vertices[:, 1])) flip_vertices[:, 0] = numpy.add(flip_vertices[:, 0], -offset_y) flip_vertices[:, 1] = numpy.add(flip_vertices[:, 1], -offset_x) - flip_vertices = numpy.ceil(flip_vertices) - shape = [int(numpy.amax(flip_vertices[:, 0])), int(numpy.amax(flip_vertices[:, 1]))] - if shape == [0, 0]: - shape = [1, 1] + shape = numpy.array([int(numpy.amax(flip_vertices[:, 0])), int(numpy.amax(flip_vertices[:, 1]))]) + shape[numpy.where(shape == 0)] = 1 arr = cls.arrayFromPolygon(shape, flip_vertices) - if not numpy.any(arr): + if not numpy.ndarray.any(arr): # set at least 1 pixel arr[0][0] = 1 return cls(arr, offset_x, offset_y)