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/PrintObject.cpp | |
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/PrintObject.cpp')
-rw-r--r-- | xs/src/libslic3r/PrintObject.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 1c1d0113e..94001cb38 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -1168,10 +1168,7 @@ PrintObject::_make_perimeters() // Filter upper layer polygons in intersection_ppl by their bounding boxes? // my $upper_layerm_poly_bboxes= [ map $_->bounding_box, @{$upper_layerm_polygons} ]; - double total_loop_length = 0; - for (Polygons::const_iterator it = upper_layerm_polygons.begin(); it != upper_layerm_polygons.end(); ++it) - total_loop_length += it->length(); - + const double total_loop_length = total_length(upper_layerm_polygons); const coord_t perimeter_spacing = layerm.flow(frPerimeter).scaled_spacing(); const Flow ext_perimeter_flow = layerm.flow(frExternalPerimeter); const coord_t ext_perimeter_width = ext_perimeter_flow.scaled_width(); @@ -1199,12 +1196,8 @@ PrintObject::_make_perimeters() ); // only add an additional loop if at least 30% of the slice loop would benefit from it - { - double total_intersection_length = 0; - for (Polylines::const_iterator it = intersection.begin(); it != intersection.end(); ++it) - total_intersection_length += it->length(); - if (total_intersection_length <= total_loop_length*0.3) break; - } + if (total_length(intersection) <= total_loop_length*0.3) + break; /* if (0) { |