diff --git a/src/libslic3r/LayerRegion.cpp b/src/libslic3r/LayerRegion.cpp index 3fc8d03d1..6fc0b4e37 100644 --- a/src/libslic3r/LayerRegion.cpp +++ b/src/libslic3r/LayerRegion.cpp @@ -365,26 +365,23 @@ void LayerRegion::prepare_fill_surfaces() // if no solid layers are requested, turn top/bottom surfaces to internal if (this->region()->config().top_solid_layers == 0) { - for (Surfaces::iterator surface = this->fill_surfaces.surfaces.begin(); surface != this->fill_surfaces.surfaces.end(); ++surface) - if (surface->surface_type == stTop) - surface->surface_type = (this->layer()->object()->config().infill_only_where_needed) ? - stInternalVoid : stInternal; + for (Surface &surface : this->fill_surfaces.surfaces) + if (surface.is_top()) + surface.surface_type = this->layer()->object()->config().infill_only_where_needed ? stInternalVoid : stInternal; } if (this->region()->config().bottom_solid_layers == 0) { - for (Surfaces::iterator surface = this->fill_surfaces.surfaces.begin(); surface != this->fill_surfaces.surfaces.end(); ++surface) { - if (surface->surface_type == stBottom || surface->surface_type == stBottomBridge) - surface->surface_type = stInternal; - } + for (Surface &surface : this->fill_surfaces.surfaces) + if (surface.is_bottom()) // (surface.surface_type == stBottom) + surface.surface_type = stInternal; } - + // turn too small internal regions into solid regions according to the user setting if (this->region()->config().fill_density.value > 0) { // scaling an area requires two calls! double min_area = scale_(scale_(this->region()->config().solid_infill_below_area.value)); - for (Surfaces::iterator surface = this->fill_surfaces.surfaces.begin(); surface != this->fill_surfaces.surfaces.end(); ++surface) { - if (surface->surface_type == stInternal && surface->area() <= min_area) - surface->surface_type = stInternalSolid; - } + for (Surface &surface : this->fill_surfaces.surfaces) + if (surface.surface_type == stInternal && surface.area() <= min_area) + surface.surface_type = stInternalSolid; } #ifdef SLIC3R_DEBUG_SLICE_PROCESSING diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index c4cc5e31d..1ce00f269 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2894,7 +2894,7 @@ void DynamicPrintConfig::normalize() { this->opt("perimeters", true)->value = 1; this->opt("top_solid_layers", true)->value = 0; - this->opt("fill_density", true)->value = 0; + this->opt("fill_density", true)->value = 0; } } }