From 310c29caa982d3edf51ff8dee4035f099e8e3eeb Mon Sep 17 00:00:00 2001 From: remi durand Date: Wed, 2 Jun 2021 13:17:37 +0200 Subject: [PATCH] fix brim_ears_detection_length --- src/libslic3r/Print.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 16b697692..57103141d 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -2336,12 +2336,12 @@ void Print::_make_brim_ears(const Flow &flow, const PrintObjectPtrs &objects, Ex Polygon decimated_polygon = poly.contour; // brim_ears_detection_length codepath if (object->config().brim_ears_detection_length.value > 0) { - //copy - decimated_polygon = poly.contour; //decimate polygon Points points = poly.contour.points; points.push_back(points.front()); - decimated_polygon = Polygon(MultiPoint::_douglas_peucker(points, scale_(object->config().brim_ears_detection_length.value))); + points = MultiPoint::_douglas_peucker(points, scale_(object->config().brim_ears_detection_length.value)); + if(points.size()>1) + points.erase(points.end() - 1); } for (const Point &p : decimated_polygon.convex_points(brim_config.brim_ears_max_angle.value * PI / 180.0)) { pt_ears.push_back(p);