diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 453317ef2c..c2db414fc5 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2370,8 +2370,13 @@ std::vector GCode::collect_layers_to_print(const PrintObjec PrintStateBase::WarningLevel::CRITICAL, warning, PrintStateBase::SlicingEmptyGcodeLayers); } - // Belt printers: drop the layers that print nothing (see the by-layer overload), so - // the by-object export writes the same layer changes as the by-layer one. + // Belt printers: drop the layers that print nothing at all. An object's slicing + // frame starts at the belt below its leading end, so its first layers are empty, + // and with several objects along the belt those empty layers fall between other + // objects' printing layers. A layer change with no moves is noise in the file, and + // the preview (libvgcode) numbers its layers from the moves it sees, so a gap folds + // every later layer into the one before it. Both print sequences collect their + // layers here, so neither writes such a layer. if (object.print()->config().belt_printer.value) layers_to_print.erase( std::remove_if(layers_to_print.begin(), layers_to_print.end(), [&object](const LayerToPrint <p) { @@ -2446,31 +2451,6 @@ std::vector>> GCode::collec layers_to_print.emplace_back(std::move(merged)); } - // Belt printers: drop the layers that print nothing at all. An object's - // slicing frame starts at the belt below its leading end, so its first layers - // are empty, and with several objects along the belt those empty layers fall - // between other objects' printing layers. A layer change with no moves is - // noise in the file, and the preview (libvgcode) numbers its layers from the - // moves it sees, so a gap folds every later layer into the one before it. - if (print.config().belt_printer.value) { - auto prints_something = [](const LayerToPrint <p) { - if (ltp.object_layer != nullptr && ltp.original_object != nullptr && - belt_object_layer_prints_something(*ltp.original_object, *ltp.object_layer)) - return true; - if (ltp.support_layer != nullptr && ltp.support_layer->has_extrusions()) - return true; - if (ltp.belt_brim_band != nullptr && ! ltp.belt_brim_band->fills.empty()) - return true; - return false; - }; - layers_to_print.erase( - std::remove_if(layers_to_print.begin(), layers_to_print.end(), - [&prints_something](const std::pair> &group) { - return std::none_of(group.second.begin(), group.second.end(), prints_something); - }), - layers_to_print.end()); - } - return layers_to_print; }