Skip to content

Commit

Permalink
FIX: fix an exception happened in flush option in debug mode
Browse files Browse the repository at this point in the history
Signed-off-by: yifan.wu <[email protected]>
Change-Id: I02847ac516f560863c126ee8bf7bfc9018c2d69e
  • Loading branch information
YifanWuBambu authored and lanewei120 committed Oct 20, 2022
1 parent 0a4269f commit 65f5788
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/libslic3r/GCode/ToolOrdering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,15 @@ float WipingExtrusions::mark_wiping_extrusions(const Print& print, unsigned int

// we will sort objects so that dedicated for wiping are at the beginning:
ConstPrintObjectPtrs object_list = print.objects().vector();
std::sort(object_list.begin(), object_list.end(), [](const PrintObject* a, const PrintObject* b) { return a->config().flush_into_objects; });
// BBS: fix the exception caused by not fixed order between different objects
std::sort(object_list.begin(), object_list.end(), [object_list](const PrintObject* a, const PrintObject* b) {
if (a->config().flush_into_objects != b->config().flush_into_objects) {
return a->config().flush_into_objects.getBool();
}
else {
return a->id() < b->id();
}
});

// We will now iterate through
// - first the dedicated objects to mark perimeters or infills (depending on infill_first)
Expand Down

0 comments on commit 65f5788

Please sign in to comment.