diff --git a/var/Slic3r-console.ico b/var/Slic3r-console.ico new file mode 100644 index 000000000..64e818340 Binary files /dev/null and b/var/Slic3r-console.ico differ diff --git a/xs/src/libslic3r/Layer.cpp b/xs/src/libslic3r/Layer.cpp index 492eb8be4..d3399d46e 100644 --- a/xs/src/libslic3r/Layer.cpp +++ b/xs/src/libslic3r/Layer.cpp @@ -129,8 +129,19 @@ Layer::make_slices() void Layer::merge_slices() { - FOREACH_LAYERREGION(this, layerm) { - (*layerm)->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) { + 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); + } } } diff --git a/xs/src/libslic3r/Layer.hpp b/xs/src/libslic3r/Layer.hpp index 14957dd1c..e59f0c9e1 100644 --- a/xs/src/libslic3r/Layer.hpp +++ b/xs/src/libslic3r/Layer.hpp @@ -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); diff --git a/xs/src/libslic3r/LayerRegion.cpp b/xs/src/libslic3r/LayerRegion.cpp index a236c0389..7c84629e2 100644 --- a/xs/src/libslic3r/LayerRegion.cpp +++ b/xs/src/libslic3r/LayerRegion.cpp @@ -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.