Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsupermerill <merill@fr.fr>2018-07-25 17:10:05 +0300
committersupermerill <merill@fr.fr>2018-07-25 17:10:05 +0300
commit202a9d0f8262f0b8b7a76ba91031a44c064717ac (patch)
tree0ef31d4ae27a9eed6487053e2c8c0052afb19d39
parentd22bfa1257035c81709db8d59aed0a01d334fec5 (diff)
Better dense infill : use external_infill_marginold_master
also better handling of count, but not perfect (i can see some shenanigan but it's not feature-breaking)
-rw-r--r--xs/src/libslic3r/PrintObject.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp
index 92464d9b4..55c6b27ee 100644
--- a/xs/src/libslic3r/PrintObject.cpp
+++ b/xs/src/libslic3r/PrintObject.cpp
@@ -451,20 +451,30 @@ void PrintObject::count_distance_solid() {
if (surf.area() > area_intersect * 3 &&
surf.maxNbSolidLayersOnTop > layerm->region()->config.infill_dense_layers.getInt()) {
//split in two
- //grew a bit
- ExPolygons intersect_bigger = offset2_ex(intersect,
- -layerm->flow(frInfill).scaled_width(),
- layerm->flow(frInfill).scaled_width()*2);
- ExPolygons sparse_surfaces = offset2_ex(
- diff_ex(sparse_polys, intersect_bigger, true),
- -layerm->flow(frInfill).scaled_width(),
- layerm->flow(frInfill).scaled_width());
- ExPolygons dense_surfaces = diff_ex(sparse_polys, sparse_surfaces, true);
- //assign (copy)
- sparse_polys.clear();
- sparse_polys.insert(sparse_polys.begin(), sparse_surfaces.begin(), sparse_surfaces.end());
- dense_polys.insert(dense_polys.end(), dense_surfaces.begin(), dense_surfaces.end());
- dense_dist = std::min(dense_dist, dist);
+ if (dist == 1) {
+ //if just under the solid area, we can expand a bit
+ //remove too small sections and grew a bit to anchor it into the part
+ intersect = offset2_ex(intersect,
+ -layerm->flow(frInfill).scaled_width(),
+ layerm->flow(frInfill).scaled_width() + scale_(layerm->region()->config.external_infill_margin));
+ } else {
+ //just remove too small sections
+ intersect = offset2_ex(intersect,
+ -layerm->flow(frInfill).scaled_width(),
+ layerm->flow(frInfill).scaled_width());
+ }
+ if (!intersect.empty()) {
+ ExPolygons sparse_surfaces = offset2_ex(
+ diff_ex(sparse_polys, intersect, true),
+ -layerm->flow(frInfill).scaled_width(),
+ layerm->flow(frInfill).scaled_width());
+ ExPolygons dense_surfaces = diff_ex(sparse_polys, sparse_surfaces, true);
+ //assign (copy)
+ sparse_polys.clear();
+ sparse_polys.insert(sparse_polys.begin(), sparse_surfaces.begin(), sparse_surfaces.end());
+ dense_polys.insert(dense_polys.end(), dense_surfaces.begin(), dense_surfaces.end());
+ dense_dist = std::min(dense_dist, dist);
+ }
} else {
surf.maxNbSolidLayersOnTop = std::min(surf.maxNbSolidLayersOnTop, dist);
}