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

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukáš Hejl <hejl.lukas@gmail.com>2022-02-22 14:38:54 +0300
committerLukáš Hejl <hejl.lukas@gmail.com>2022-02-22 14:39:10 +0300
commitdbc3cfc004be84441ef5a00cc52887b07b019e89 (patch)
tree213e406e7588d7f7d96412aee84a9ee59e4c5baa
parent46939dd6b8c26bb9bd7b40ff6c16960ddf408171 (diff)
Fixed an issue that, in some cases, an inner brim was not generated.version_2.4.1-beta2
-rw-r--r--src/libslic3r/Brim.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/libslic3r/Brim.cpp b/src/libslic3r/Brim.cpp
index 5d1fa1858..0fec89ced 100644
--- a/src/libslic3r/Brim.cpp
+++ b/src/libslic3r/Brim.cpp
@@ -298,6 +298,7 @@ static std::vector<InnerBrimExPolygons> inner_brim_area(const Print
const float brim_width = scale_(object->config().brim_width.value);
const bool top_outer_brim = top_level_objects_idx.find(object->id().id) != top_level_objects_idx.end();
+ ExPolygons brim_area_innermost_object;
ExPolygons brim_area_object;
ExPolygons no_brim_area_object;
Polygons holes_reversed_object;
@@ -310,33 +311,35 @@ static std::vector<InnerBrimExPolygons> inner_brim_area(const Print
}
// After 7ff76d07684858fd937ef2f5d863f105a10f798e offset and shrink don't work with CW polygons (holes), so let's make it CCW.
- holes_reversed_object = ex_poly.holes;
- polygons_reverse(holes_reversed_object);
-
- if (brim_type == BrimType::btInnerOnly || brim_type == BrimType::btNoBrim)
- append(no_brim_area_object, diff_ex(offset(ex_poly.contour, no_brim_offset, ClipperLib::jtSquare), holes_reversed_object));
-
- if (brim_type == BrimType::btOuterOnly || brim_type == BrimType::btNoBrim)
- append(no_brim_area_object, diff_ex(ExPolygon(ex_poly.contour), shrink_ex(holes_reversed_object, no_brim_offset, ClipperLib::jtSquare)));
- }
- append(no_brim_area_object, offset_ex(bottom_layers_expolygons[print_object_idx], brim_separation, ClipperLib::jtSquare));
-
- for (const PrintInstance &instance : object->instances()) {
- for (const ExPolygon &ex_poly : bottom_layers_expolygons[print_object_idx]) {
+ Polygons ex_poly_holes_reversed = ex_poly.holes;
+ polygons_reverse(ex_poly_holes_reversed);
+ for (const PrintInstance &instance : object->instances()) {
++polygon_idx; // Increase idx because of the contour of the ExPolygon.
if (brim_type == BrimType::btInnerOnly || brim_type == BrimType::btOuterAndInner)
- for (const Polygon &hole : holes_reversed_object) {
- size_t hole_idx = &hole - &holes_reversed_object.front();
+ for(const Polygon &hole : ex_poly_holes_reversed) {
+ size_t hole_idx = &hole - &ex_poly_holes_reversed.front();
if (has_nothing_inside[polygon_idx + hole_idx])
- append_and_translate(brim_area_innermost[print_object_idx], shrink_ex({hole}, brim_separation, ClipperLib::jtSquare), instance);
+ append(brim_area_innermost_object, shrink_ex({hole}, brim_separation, ClipperLib::jtSquare));
else
- append_and_translate(brim_area, diff_ex(shrink_ex({hole}, brim_separation, ClipperLib::jtSquare), shrink_ex({hole}, brim_width + brim_separation, ClipperLib::jtSquare)), instance);
+ append(brim_area_object, diff_ex(shrink_ex({hole}, brim_separation, ClipperLib::jtSquare), shrink_ex({hole}, brim_width + brim_separation, ClipperLib::jtSquare)));
}
polygon_idx += ex_poly.holes.size(); // Increase idx for every hole of the ExPolygon.
}
+ if (brim_type == BrimType::btInnerOnly || brim_type == BrimType::btNoBrim)
+ append(no_brim_area_object, diff_ex(offset(ex_poly.contour, no_brim_offset, ClipperLib::jtSquare), ex_poly_holes_reversed));
+
+ if (brim_type == BrimType::btOuterOnly || brim_type == BrimType::btNoBrim)
+ append(no_brim_area_object, diff_ex(ExPolygon(ex_poly.contour), shrink_ex(ex_poly_holes_reversed, no_brim_offset, ClipperLib::jtSquare)));
+
+ append(holes_reversed_object, ex_poly_holes_reversed);
+ }
+ append(no_brim_area_object, offset_ex(bottom_layers_expolygons[print_object_idx], brim_separation, ClipperLib::jtSquare));
+
+ for (const PrintInstance &instance : object->instances()) {
+ append_and_translate(brim_area_innermost[print_object_idx], brim_area_innermost_object, instance);
append_and_translate(brim_area, brim_area_object, instance);
append_and_translate(no_brim_area, no_brim_area_object, instance);
append_and_translate(holes_reversed, holes_reversed_object, instance);