Simplification, C++11 beautification.

This commit is contained in:
bubnikv 2017-04-05 09:51:03 +02:00
parent ef2cfdb0d1
commit 555560f63c

View file

@ -297,30 +297,22 @@ PerimeterGenerator::process()
// two or more loops // two or more loops
inset += pspacing/2; inset += pspacing/2;
} }
// only apply infill overlap if we actually have one perimeter // only apply infill overlap if we actually have one perimeter
if (inset > 0) if (inset > 0)
inset -= this->config->get_abs_value("infill_overlap", inset + ispacing/2); inset -= this->config->get_abs_value("infill_overlap", inset + ispacing/2);
// simplify infill contours according to resolution
{ Polygons pp;
ExPolygons expp = union_ex(last); for (ExPolygon &ex : union_ex(last))
ex.simplify_p(SCALED_RESOLUTION, &pp);
// simplify infill contours according to resolution // collapse too narrow infill areas
Polygons pp; coord_t min_perimeter_infill_spacing = ispacing * (1 - INSET_OVERLAP_TOLERANCE);
for (ExPolygons::const_iterator ex = expp.begin(); ex != expp.end(); ++ex) // append infill areas to fill_surfaces
ex->simplify_p(SCALED_RESOLUTION, &pp); this->fill_surfaces->append(
offset2_ex(
// collapse too narrow infill areas pp,
coord_t min_perimeter_infill_spacing = ispacing * (1 - INSET_OVERLAP_TOLERANCE); -inset -min_perimeter_infill_spacing/2,
+min_perimeter_infill_spacing/2),
// append infill areas to fill_surfaces stInternal);
this->fill_surfaces->append(
offset2_ex(
pp,
-inset -min_perimeter_infill_spacing/2,
+min_perimeter_infill_spacing/2),
stInternal);
}
} // for each island } // for each island
} }