From ac4873d97686135b773226eb3487f0cc8cfe0503 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 15 Jan 2025 17:29:09 +0800 Subject: [PATCH] ENH: improve auto arranging of multiple single color objects If two objects have similar area, sort them by extruder id. jira: STUDIO-9760 github: #5738 Change-Id: I6041fef4d3bfccce767555ac382688eea59e73c7 --- src/libslic3r/Arrange.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Arrange.cpp b/src/libslic3r/Arrange.cpp index 0b340ff1e..49198b345 100644 --- a/src/libslic3r/Arrange.cpp +++ b/src/libslic3r/Arrange.cpp @@ -687,8 +687,10 @@ public: if (p1 != p2) return p1 > p2; if (params.is_seq_print) { - return i1.bed_temp != i2.bed_temp ? (i1.bed_temp > i2.bed_temp) : - (i1.height != i2.height ? (i1.height < i2.height) : (i1.area() > i2.area())); + return i1.bed_temp != i2.bed_temp ? (i1.bed_temp > i2.bed_temp) : + i1.height != i2.height ? (i1.height < i2.height) : + std::abs(i1.area() / i2.area() - 1) > 0.2 ? (i1.area() > i2.area()) : + i1.extrude_ids.front() < i2.extrude_ids.front(); } else { // single color objects first, then objects with more colors