From e7c977f86b1a727541f20eeec18699abef46c2ce Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 7 Sep 2022 18:03:09 +0800 Subject: [PATCH] ENH: move first layer inspection before 2nd layer So an object with a single layer won't do first layer inspection. Change-Id: I43d8d41b64215b13573c517e6350f7feff5f2e33 --- src/libslic3r/GCode.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index b56ef7994..358656b17 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2504,6 +2504,14 @@ GCode::LayerResult GCode::process_layer( gcode += "; open powerlost recovery\n"; gcode += "M1003 S1\n"; } + // BBS: open first layer inspection at second layer + if (print.config().scan_first_layer.value) { + // BBS: retract first to avoid droping when scan model + gcode += this->retract(); + gcode += "M976 S1 P1 ; scan model before printing 2nd layer\n"; + gcode += "M400 P100\n"; + gcode += this->unretract(); + } //BBS: reset acceleration at sencond layer if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) { @@ -3025,18 +3033,6 @@ GCode::LayerResult GCode::process_layer( file.write(gcode); #endif - // BBS: scan model after print first layer - // Note: for sequential printing, every object will have this - if (print.config().scan_first_layer.value) { - if (first_layer) { - //BBS: retract first to avoid droping when scan model - gcode += this->retract(); - gcode += "M976 S1 P1 ; scan model after print first layer\n"; - gcode += "M400 P100\n"; - gcode += this->unretract(); - } - } - BOOST_LOG_TRIVIAL(trace) << "Exported layer " << layer.id() << " print_z " << print_z << log_memory_info();