Merge remote-tracking branch 'remote/master' into SoftFever

# Conflicts:
#	src/libslic3r/Preset.cpp
This commit is contained in:
SoftFever 2022-09-09 21:54:57 +08:00
commit bb74438f7c
132 changed files with 5737 additions and 3598 deletions

View file

@ -2507,6 +2507,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) {
@ -2661,7 +2669,29 @@ GCode::LayerResult GCode::process_layer(
}
}
if (support_dontcare || interface_dontcare) {
if (interface_dontcare) {
int extruder_override = wiping_extrusions.get_support_interface_extruder_overrides(&object);
if (extruder_override >= 0) {
interface_extruder = extruder_override;
interface_dontcare = false;
}
}
// BBS: try to print support base with a filament other than interface filament
if (support_dontcare && !interface_dontcare) {
unsigned int dontcare_extruder = first_extruder_id;
for (unsigned int extruder_id : layer_tools.extruders) {
if (print.config().filament_soluble.get_at(extruder_id)) continue;
if (extruder_id == interface_extruder) continue;
dontcare_extruder = extruder_id;
break;
}
if (support_dontcare) support_extruder = dontcare_extruder;
}
else if (support_dontcare || interface_dontcare) {
// Some support will be printed with "don't care" material, preferably non-soluble.
// Is the current extruder assigned a soluble filament?
unsigned int dontcare_extruder = first_extruder_id;
@ -3028,18 +3058,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();
@ -3839,8 +3857,8 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction)
if (m_writer.extruder() == nullptr)
return gcode;
// wipe (if it's enabled for this extruder and we have a stored wipe path)
if (EXTRUDER_CONFIG(wipe) && m_wipe.has_path()) {
// wipe (if it's enabled for this extruder and we have a stored wipe path and no-zero wipe distance)
if (EXTRUDER_CONFIG(wipe) && m_wipe.has_path() && scale_(EXTRUDER_CONFIG(wipe_distance)) > SCALED_EPSILON) {
gcode += toolchange ? m_writer.retract_for_toolchange(true) : m_writer.retract(true);
gcode += m_wipe.wipe(*this, toolchange, is_last_retraction);
}