Skip to content

Commit

Permalink
Fix perimeter artifacts when full resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Mar 31, 2022
1 parent 8bc0050 commit 2027029
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/libslic3r/PerimeterGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,10 @@ void PerimeterGenerator::process()
ExPolygons top_fills;
ExPolygons fill_clip;
// simplification already done at slicing
//ExPolygons last = union_ex(surface.expolygon.simplify_p(SCALED_RESOLUTION));
ExPolygons last = union_ex(surface.expolygon);
double last_area = -1;
//simplify the loop to avoid artifacts when shrinking almost-0 segments
coord_t resolution = scale_t(this->print_config->resolution.value);
ExPolygons last = union_ex(surface.expolygon.simplify_p((resolution < SCALED_EPSILON ? SCALED_EPSILON : resolution)));
double last_area = -1;

if (loop_number >= 0) {

Expand Down Expand Up @@ -702,7 +703,12 @@ void PerimeterGenerator::process()
holes[i].emplace_back(hole, i, false, has_steep_overhang);
}
}
last = std::move(next_onion);

//simplify the loop to avoid artifacts when shrinking almost-0 segments
resolution = scale_t(this->print_config->resolution.value);
last.clear();
for(ExPolygon& exp : next_onion)
exp.simplify((resolution < SCALED_EPSILON ? SCALED_EPSILON : resolution), &last);

//store surface for top infill if only_one_perimeter_top
if (i == 0 && (config->only_one_perimeter_top && this->upper_slices != NULL)) {
Expand Down

0 comments on commit 2027029

Please sign in to comment.