From 555560f63cf4439392556231d8bbe1ca959be00e Mon Sep 17 00:00:00 2001 From: bubnikv Date: Wed, 5 Apr 2017 09:51:03 +0200 Subject: [PATCH] Simplification, C++11 beautification. --- xs/src/libslic3r/PerimeterGenerator.cpp | 34 ++++++++++--------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/xs/src/libslic3r/PerimeterGenerator.cpp b/xs/src/libslic3r/PerimeterGenerator.cpp index 41c80d8b0..871ded2c2 100644 --- a/xs/src/libslic3r/PerimeterGenerator.cpp +++ b/xs/src/libslic3r/PerimeterGenerator.cpp @@ -297,30 +297,22 @@ PerimeterGenerator::process() // two or more loops inset += pspacing/2; } - // only apply infill overlap if we actually have one perimeter if (inset > 0) inset -= this->config->get_abs_value("infill_overlap", inset + ispacing/2); - - { - ExPolygons expp = union_ex(last); - - // simplify infill contours according to resolution - Polygons pp; - for (ExPolygons::const_iterator ex = expp.begin(); ex != expp.end(); ++ex) - ex->simplify_p(SCALED_RESOLUTION, &pp); - - // collapse too narrow infill areas - coord_t min_perimeter_infill_spacing = ispacing * (1 - INSET_OVERLAP_TOLERANCE); - - // append infill areas to fill_surfaces - this->fill_surfaces->append( - offset2_ex( - pp, - -inset -min_perimeter_infill_spacing/2, - +min_perimeter_infill_spacing/2), - stInternal); - } + // simplify infill contours according to resolution + Polygons pp; + for (ExPolygon &ex : union_ex(last)) + ex.simplify_p(SCALED_RESOLUTION, &pp); + // collapse too narrow infill areas + coord_t min_perimeter_infill_spacing = ispacing * (1 - INSET_OVERLAP_TOLERANCE); + // append infill areas to fill_surfaces + this->fill_surfaces->append( + offset2_ex( + pp, + -inset -min_perimeter_infill_spacing/2, + +min_perimeter_infill_spacing/2), + stInternal); } // for each island }