diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 9e7ffc009a..7f65436ae4 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3265,12 +3265,10 @@ std::string GCodeGenerator::_extrude( } if (m_enable_cooling_markers) - gcode += path_attr.role.is_bridge() ? ";_BRIDGE_FAN_END" : ";_EXTRUDE_END"; + gcode += path_attr.role.is_bridge() ? ";_BRIDGE_FAN_END\n" : ";_EXTRUDE_END\n"; if (dynamic_speed_and_fan_speed.second >= 0) - gcode += ";_RESET_FAN_SPEED"; - - gcode += "\n"; + gcode += ";_RESET_FAN_SPEED\n"; this->set_last_pos(path.back().point); return gcode; diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index 33aa46b6d8..e599301b14 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -560,16 +560,18 @@ std::vector CoolingBuffer::parse_layer_gcode(const std:: } else line.time = 0; line.time_max = line.time; - } else if (boost::contains(sline, ";_SET_FAN_SPEED")) { + } + + if (boost::contains(sline, ";_SET_FAN_SPEED")) { auto speed_start = sline.find_last_of('D'); int speed = 0; for (char num : sline.substr(speed_start + 1)) { speed = speed * 10 + (num - '0'); } - line.type = CoolingLine::TYPE_SET_FAN_SPEED; + line.type |= CoolingLine::TYPE_SET_FAN_SPEED; line.fan_speed = speed; } else if (boost::contains(sline, ";_RESET_FAN_SPEED")) { - line.type = CoolingLine::TYPE_RESET_FAN_SPEED; + line.type |= CoolingLine::TYPE_RESET_FAN_SPEED; } if (line.type != 0)