diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 35af30514a..f601504687 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2419,6 +2419,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_max_layer_z = 0.f; m_last_width = 0.f; m_is_role_based_fan_on.fill(false); + m_role_based_fan_marker_layer.fill(-1); m_fan_mover.release(); @@ -6746,11 +6747,14 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, assert(m_enable_cooling_markers); if (fan_on) { - if (!m_is_role_based_fan_on[role]) { + // Orca: CoolingBuffer consumes role fan markers per layer, so continuing + // role-based fan regions need a fresh START marker on each new layer. + if (!m_is_role_based_fan_on[role] || m_role_based_fan_marker_layer[role] != m_layer_index) { gcode += ";"; gcode += marker_prefix; gcode += "_FAN_START\n"; m_is_role_based_fan_on[role] = true; + m_role_based_fan_marker_layer[role] = m_layer_index; } } else { if (m_is_role_based_fan_on[role]) { @@ -6758,6 +6762,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, gcode += marker_prefix; gcode += "_FAN_END\n"; m_is_role_based_fan_on[role] = false; + m_role_based_fan_marker_layer[role] = -1; } } }; diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index fb2a546890..03e76a1eff 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -559,6 +559,7 @@ private: std::string _encode_label_ids_to_base64(std::vector ids); // ORCA: Add support for role based fan speed control std::array m_is_role_based_fan_on; + std::array m_role_based_fan_marker_layer; // Markers for the Pressure Equalizer to recognize the extrusion type. // The Pressure Equalizer removes the markers from the final G-code. bool m_enable_extrusion_role_markers;