diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2015-12-14 02:15:04 +0300 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2015-12-14 02:15:26 +0300 |
commit | 21364b7cd10fa503bde4b53c53f97c2e76b75203 (patch) | |
tree | 9ce70c8dd2b71a2b4a295061ca44c00423479d63 /xs/src/libslic3r/Geometry.cpp | |
parent | 7ecfe195f766d0a526c5b220a5c6ece33ead2805 (diff) |
Fix one regression in arrange
Diffstat (limited to 'xs/src/libslic3r/Geometry.cpp')
-rw-r--r-- | xs/src/libslic3r/Geometry.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xs/src/libslic3r/Geometry.cpp b/xs/src/libslic3r/Geometry.cpp index a43aa814a..dcac40ad4 100644 --- a/xs/src/libslic3r/Geometry.cpp +++ b/xs/src/libslic3r/Geometry.cpp @@ -186,7 +186,7 @@ arrange(size_t total_parts, Pointf part, coordf_t dist, const BoundingBoxf* bb) // this is how many cells we have available into which to put parts size_t cellw = floor((area.x + dist) / part.x); - size_t cellh = floor((area.x + dist) / part.x); + size_t cellh = floor((area.y + dist) / part.y); if (total_parts > (cellw * cellh)) CONFESS("%zu parts won't fit in your print area!\n", total_parts); @@ -200,8 +200,8 @@ arrange(size_t total_parts, Pointf part, coordf_t dist, const BoundingBoxf* bb) // center bounding box to area cells_bb.translate( - -(area.x - cells.x) / 2, - -(area.y - cells.y) / 2 + (area.x - cells.x) / 2, + (area.y - cells.y) / 2 ); // list of cells, sorted by distance from center @@ -211,7 +211,7 @@ arrange(size_t total_parts, Pointf part, coordf_t dist, const BoundingBoxf* bb) for (size_t i = 0; i <= cellw-1; ++i) { for (size_t j = 0; j <= cellh-1; ++j) { coordf_t cx = linint(i + 0.5, 0, cellw, cells_bb.min.x, cells_bb.max.x); - coordf_t cy = linint(j + 0.5, 0, cellh, cells_bb.max.y, cells_bb.min.y); + coordf_t cy = linint(j + 0.5, 0, cellh, cells_bb.min.y, cells_bb.max.y); coordf_t xd = fabs((area.x / 2) - cx); coordf_t yd = fabs((area.y / 2) - cy); @@ -285,6 +285,7 @@ arrange(size_t total_parts, Pointf part, coordf_t dist, const BoundingBoxf* bb) p->y += bb->min.y; } } + return positions; } |