mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
CURA-4672 now unbreak arrange for large objects as well :-)
This commit is contained in:
parent
0d7f139cd5
commit
5e26ecb458
1 changed files with 3 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue