diff options
author | bubnikv <bubnikv@gmail.com> | 2017-02-15 19:51:46 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2017-02-15 19:51:46 +0300 |
commit | 3bfa6416d87f920d4656c3ab602f02ef41e33180 (patch) | |
tree | 097751066f461855782fb8bc4bb868398963e4af /xs/src/libslic3r/ExtrusionEntity.cpp | |
parent | 2ddabe5fa8e40519f8a5df4eda7ca8ebd3a265b0 (diff) |
Fixed https://github.com/prusa3d/Slic3r/issues/126version_1.33.4
by re-shuffling the simplification of a path to be extruded.
A non-simplified path was being used for a wipe move before,
causing an extremely detailed path to be exported into a G-code.
Diffstat (limited to 'xs/src/libslic3r/ExtrusionEntity.cpp')
-rw-r--r-- | xs/src/libslic3r/ExtrusionEntity.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/xs/src/libslic3r/ExtrusionEntity.cpp b/xs/src/libslic3r/ExtrusionEntity.cpp index dc7cfe061..880dcaad0 100644 --- a/xs/src/libslic3r/ExtrusionEntity.cpp +++ b/xs/src/libslic3r/ExtrusionEntity.cpp @@ -100,17 +100,17 @@ double ExtrusionMultiPath::min_mm3_per_mm() const Polyline ExtrusionMultiPath::as_polyline() const { - size_t len = 0; - for (size_t i_path = 0; i_path < paths.size(); ++ i_path) { - assert(! paths[i_path].polyline.points.empty()); - assert(i_path == 0 || paths[i_path - 1].polyline.points.back() == paths[i_path].polyline.points.front()); - len += paths[i_path].polyline.points.size(); - } - // The connecting points between the segments are equal. - len -= paths.size() - 1; - Polyline out; - if (len > 0) { + if (! paths.empty()) { + size_t len = 0; + for (size_t i_path = 0; i_path < paths.size(); ++ i_path) { + assert(! paths[i_path].polyline.points.empty()); + assert(i_path == 0 || paths[i_path - 1].polyline.points.back() == paths[i_path].polyline.points.front()); + len += paths[i_path].polyline.points.size(); + } + // The connecting points between the segments are equal. + len -= paths.size() - 1; + assert(len > 0); out.points.reserve(len); out.points.push_back(paths.front().polyline.points.front()); for (size_t i_path = 0; i_path < paths.size(); ++ i_path) |