Skip to content

Commit 863e489

Browse files
committed
Actually always remove vertices that always can be.
part of CURA-7794
1 parent a3a043c commit 863e489

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/utils/polygon.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,11 @@ void PolygonRef::simplify(const coord_t smallest_line_segment_squared, const coo
355355
accumulated_area_removed += removed_area_next;
356356

357357
const coord_t length2 = vSize2(current - previous);
358+
if (length2 < 25)
359+
{
360+
// We're allowed to always delete segments of less than 5 micron.
361+
continue;
362+
}
358363

359364
const coord_t area_removed_so_far = accumulated_area_removed + negative_area_closing; // close the shortcut area polygon
360365
const coord_t base_length_2 = vSize2(next - previous);
@@ -395,11 +400,6 @@ void PolygonRef::simplify(const coord_t smallest_line_segment_squared, const coo
395400
|| vSize2(intersection_point - previous) > smallest_line_segment_squared // The intersection point is way too far from the 'previous'
396401
|| vSize2(intersection_point - next) > smallest_line_segment_squared) // and 'next' points, so it shouldn't replace 'current'
397402
{
398-
if(length2 < 25)
399-
{
400-
// We're allowed to always delete segments of less than 5 micron.
401-
continue;
402-
}
403403
// We can't find a better spot for it, but the size of the line is more than 5 micron.
404404
// So the only thing we can do here is leave it in...
405405
}

0 commit comments

Comments
 (0)