Fix dense_infill when infill/perimeter encroachment is 0

supermerill/SuperSlicer#2243
This commit is contained in:
supermerill 2022-02-02 00:25:59 +01:00
parent 878ea577c7
commit 56b2f2b483
2 changed files with 4 additions and 1 deletions

View File

@ -43,6 +43,7 @@ public:
// and for re-starting of infills.
ExPolygons fill_expolygons;
// Unspecified fill polygons, used for interecting when we don't want the infill/perimeter overlap
// note: if empty, that means there is no overlap, so you don't need to intersect with it.
ExPolygons fill_no_overlap_expolygons;
// collection of surfaces for infill generation
SurfaceCollection fill_surfaces;

View File

@ -1330,7 +1330,9 @@ namespace Slic3r {
for (int idx_dense = 0; idx_dense < dense_polys.size(); idx_dense++) {
ExPolygon dense_poly = dense_polys[idx_dense];
//remove overlap with perimeter
ExPolygons offseted_dense_polys = intersection_ex({ dense_poly }, layerm->fill_no_overlap_expolygons);
ExPolygons offseted_dense_polys = layerm->fill_no_overlap_expolygons.empty()
? ExPolygons{dense_poly}
: intersection_ex({ dense_poly }, layerm->fill_no_overlap_expolygons);
//add overlap with everything
offseted_dense_polys = offset_ex(offseted_dense_polys, overlap);
for (ExPolygon offseted_dense_poly : offseted_dense_polys) {