mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Some C++11 refactoring
This commit is contained in:
parent
413e737d7e
commit
b9389f2d39
2 changed files with 11 additions and 14 deletions
|
@ -365,26 +365,23 @@ void LayerRegion::prepare_fill_surfaces()
|
||||||
|
|
||||||
// if no solid layers are requested, turn top/bottom surfaces to internal
|
// if no solid layers are requested, turn top/bottom surfaces to internal
|
||||||
if (this->region()->config().top_solid_layers == 0) {
|
if (this->region()->config().top_solid_layers == 0) {
|
||||||
for (Surfaces::iterator surface = this->fill_surfaces.surfaces.begin(); surface != this->fill_surfaces.surfaces.end(); ++surface)
|
for (Surface &surface : this->fill_surfaces.surfaces)
|
||||||
if (surface->surface_type == stTop)
|
if (surface.is_top())
|
||||||
surface->surface_type = (this->layer()->object()->config().infill_only_where_needed) ?
|
surface.surface_type = this->layer()->object()->config().infill_only_where_needed ? stInternalVoid : stInternal;
|
||||||
stInternalVoid : stInternal;
|
|
||||||
}
|
}
|
||||||
if (this->region()->config().bottom_solid_layers == 0) {
|
if (this->region()->config().bottom_solid_layers == 0) {
|
||||||
for (Surfaces::iterator surface = this->fill_surfaces.surfaces.begin(); surface != this->fill_surfaces.surfaces.end(); ++surface) {
|
for (Surface &surface : this->fill_surfaces.surfaces)
|
||||||
if (surface->surface_type == stBottom || surface->surface_type == stBottomBridge)
|
if (surface.is_bottom()) // (surface.surface_type == stBottom)
|
||||||
surface->surface_type = stInternal;
|
surface.surface_type = stInternal;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn too small internal regions into solid regions according to the user setting
|
// turn too small internal regions into solid regions according to the user setting
|
||||||
if (this->region()->config().fill_density.value > 0) {
|
if (this->region()->config().fill_density.value > 0) {
|
||||||
// scaling an area requires two calls!
|
// scaling an area requires two calls!
|
||||||
double min_area = scale_(scale_(this->region()->config().solid_infill_below_area.value));
|
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) {
|
for (Surface &surface : this->fill_surfaces.surfaces)
|
||||||
if (surface->surface_type == stInternal && surface->area() <= min_area)
|
if (surface.surface_type == stInternal && surface.area() <= min_area)
|
||||||
surface->surface_type = stInternalSolid;
|
surface.surface_type = stInternalSolid;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
|
|
|
@ -2894,7 +2894,7 @@ void DynamicPrintConfig::normalize()
|
||||||
{
|
{
|
||||||
this->opt<ConfigOptionInt>("perimeters", true)->value = 1;
|
this->opt<ConfigOptionInt>("perimeters", true)->value = 1;
|
||||||
this->opt<ConfigOptionInt>("top_solid_layers", true)->value = 0;
|
this->opt<ConfigOptionInt>("top_solid_layers", true)->value = 0;
|
||||||
this->opt<ConfigOptionPercent>("fill_density", true)->value = 0;
|
this->opt<ConfigOptionPercent>("fill_density", true)->value = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue