diff options
author | bubnikv <bubnikv@gmail.com> | 2017-02-02 18:03:32 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2017-02-02 18:03:32 +0300 |
commit | 4256af22ff628156c85349c217ff46c1e41321a2 (patch) | |
tree | a5095c860f86d1ab7d11c55feab87fe5edd1c884 /xs/src/libslic3r/Polyline.hpp | |
parent | c25ae357377f8738da5e29b82b085a75960f27c5 (diff) |
Created a total_lengt() free function for Polygons and Polylines.
Modified the "extra perimeters when needed" function to use the new free functions,
extended the tooltip of the "extra perimeters when needed" feature.
Diffstat (limited to 'xs/src/libslic3r/Polyline.hpp')
-rw-r--r-- | xs/src/libslic3r/Polyline.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xs/src/libslic3r/Polyline.hpp b/xs/src/libslic3r/Polyline.hpp index d304ba19a..ac59c6378 100644 --- a/xs/src/libslic3r/Polyline.hpp +++ b/xs/src/libslic3r/Polyline.hpp @@ -69,6 +69,13 @@ public: extern BoundingBox get_extents(const Polyline &polyline); extern BoundingBox get_extents(const Polylines &polylines); +inline double total_length(const Polylines &polylines) { + double total = 0; + for (Polylines::const_iterator it = polylines.begin(); it != polylines.end(); ++it) + total += it->length(); + return total; +} + inline Lines to_lines(const Polyline &poly) { Lines lines; |