Bugfixes of the new adaptive elephant foot compensation.

This commit is contained in:
bubnikv 2019-11-04 11:26:36 +01:00
parent bb8d59391f
commit 4c735192ef
3 changed files with 34 additions and 23 deletions

View file

@ -1819,11 +1819,12 @@ end:
if (delta < 0.f || elephant_foot_compensation > 0.f) {
// Apply the negative XY compensation.
Polygons trimming;
static const float eps = float(scale_(m_config.slice_closing_radius.value) * 1.5);
if (elephant_foot_compensation > 0.f) {
trimming = to_polygons(Slic3r::elephant_foot_compensation(offset_ex(layer->merged(float(EPSILON)), std::min(delta, 0.f) - float(EPSILON)),
trimming = to_polygons(Slic3r::elephant_foot_compensation(offset_ex(layer->merged(eps), std::min(delta, 0.f) - eps),
layer->m_regions.front()->flow(frExternalPerimeter), unscale<double>(elephant_foot_compensation)));
} else
trimming = offset(layer->merged(float(EPSILON)), delta - float(EPSILON));
trimming = offset(layer->merged(float(SCALED_EPSILON)), delta - float(SCALED_EPSILON));
for (size_t region_id = 0; region_id < layer->m_regions.size(); ++ region_id)
layer->m_regions[region_id]->trim_surfaces(trimming);
}