diff options
author | bubnikv <bubnikv@gmail.com> | 2017-06-13 12:43:25 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2017-06-13 12:43:25 +0300 |
commit | a4992602eef7e19721efebf145a3361af227978e (patch) | |
tree | b06c37fec75094ce0a4e547bd2a0e16f9ca35cf9 /xs | |
parent | 5cae4cc614dc379b35bba6397ea2bf83f0adac56 (diff) |
Auto arrange: Do at least something if the objects do not fit the bed.
Thans @alexr
https://github.com/prusa3d/Slic3r/issues/336
Diffstat (limited to 'xs')
-rw-r--r-- | xs/src/libslic3r/Model.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/xs/src/libslic3r/Model.cpp b/xs/src/libslic3r/Model.cpp index 7b4e88c52..29a3786fd 100644 --- a/xs/src/libslic3r/Model.cpp +++ b/xs/src/libslic3r/Model.cpp @@ -167,13 +167,26 @@ TriangleMesh Model::mesh() const static bool _arrange(const Pointfs &sizes, coordf_t dist, const BoundingBoxf* bb, Pointfs &out) { // we supply unscaled data to arrange() - return Slic3r::Geometry::arrange( + bool result = Slic3r::Geometry::arrange( sizes.size(), // number of parts BoundingBoxf(sizes).max, // width and height of a single cell dist, // distance between cells bb, // bounding box of the area to fill out // output positions ); + + if (!result && bb != nullptr) { + // Try to arrange again ignoring bb + result = Slic3r::Geometry::arrange( + sizes.size(), // number of parts + BoundingBoxf(sizes).max, // width and height of a single cell + dist, // distance between cells + nullptr, // bounding box of the area to fill + out // output positions + ); + } + + return result; } /* arrange objects preserving their instance count |