mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
CURA-4672 fix auto arrange for small models, they are now rounded up to 1 pixel rasterized
This commit is contained in:
parent
7b8f951682
commit
abdc33a0b9
2 changed files with 13 additions and 0 deletions
|
@ -29,8 +29,14 @@ 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]
|
||||
arr = cls.arrayFromPolygon(shape, flip_vertices)
|
||||
if not numpy.any(arr):
|
||||
# set at least 1 pixel
|
||||
arr[0][0] = 1
|
||||
return cls(arr, offset_x, offset_y)
|
||||
|
||||
## Instantiate an offset and hull ShapeArray from a scene node.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue