Optimized Layer::merge_slices()

Don't merge classified pieces of layerm->slices, but use the non-split
islands of a layer. For a single region print, these shall be equal.

Added Slic3r-console.ico windows icon for the console Slic3r.
This is a copy of the big icon, with the big images stripped off.
This commit is contained in:
bubnikv 2016-11-20 12:38:59 +01:00
parent 79f5a16536
commit ef69474636
4 changed files with 14 additions and 13 deletions

BIN
var/Slic3r-console.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -129,8 +129,19 @@ Layer::make_slices()
void
Layer::merge_slices()
{
if (this->regions.size() == 1) {
// Optimization, also more robust. Don't merge classified pieces of layerm->slices,
// but use the non-split islands of a layer. For a single region print, these shall be equal.
this->regions.front()->slices.surfaces.clear();
surfaces_append(this->regions.front()->slices.surfaces, this->slices.expolygons, stInternal);
} else {
FOREACH_LAYERREGION(this, layerm) {
(*layerm)->merge_slices();
ExPolygons expp;
// without safety offset, artifacts are generated (GH #2494)
union_(to_polygons(STDMOVE((*layerm)->slices.surfaces)), &expp, true);
(*layerm)->slices.surfaces.clear();
surfaces_append((*layerm)->slices.surfaces, expp, stInternal);
}
}
}

View File

@ -63,7 +63,6 @@ class LayerRegion
ExtrusionEntityCollection fills;
Flow flow(FlowRole role, bool bridge = false, double width = -1) const;
void merge_slices();
void slices_to_fill_surfaces_clipped();
void prepare_fill_surfaces();
void make_perimeters(const SurfaceCollection &slices, SurfaceCollection* fill_surfaces);

View File

@ -41,16 +41,6 @@ LayerRegion::flow(FlowRole role, bool bridge, double width) const
);
}
void
LayerRegion::merge_slices()
{
ExPolygons expp;
// without safety offset, artifacts are generated (GH #2494)
union_(to_polygons(STDMOVE(this->slices.surfaces)), &expp, true);
this->slices.surfaces.clear();
surfaces_append(this->slices.surfaces, expp, stInternal);
}
// Fill in layerm->fill_surfaces by trimming the layerm->slices by the cummulative layerm->fill_surfaces.
void LayerRegion::slices_to_fill_surfaces_clipped()
{
@ -126,6 +116,7 @@ LayerRegion::process_external_surfaces(const Layer* lower_layer)
// Internal surfaces, not grown.
Surfaces internal;
// Areas, where an infill of various types (top, bottom, bottom bride, sparse, void) could be placed.
//FIXME if non zero infill, then fill_boundaries could be cheaply initialized from layerm->fill_expolygons.
Polygons fill_boundaries;
// Collect top surfaces and internal surfaces.