diff --git a/src/libslic3r/GCode/FanMover.cpp b/src/libslic3r/GCode/FanMover.cpp index 989e08bdb8a..f82c6471a68 100644 --- a/src/libslic3r/GCode/FanMover.cpp +++ b/src/libslic3r/GCode/FanMover.cpp @@ -442,17 +442,20 @@ void FanMover::_process_gcode_line(GCodeReader& reader, const GCodeReader::GCode if (line.has(Axis::E)) { new_data.e = reader.e(); if (relative_e) { - assert(new_data.e == 0); new_data.de = line.e(); + // GCode reader doesn't know it's relative extrusion, we have to do it ourself. + //assert(new_data.e == 0); + new_data.e = 0; } else new_data.de = line.dist_E(reader); } assert(new_data.dx == 0 || reader.x() == new_data.x); - assert(new_data.dx == 0 || reader.x() + new_data.dx == line.x()); - assert(new_data.dy == 0 ||reader.y() == new_data.y); - assert(new_data.dy == 0 || reader.y() + new_data.dy == line.y()); - assert(new_data.de == 0 || reader.e() == new_data.e); - assert(new_data.de == 0 || reader.e() + new_data.de == line.e()); + assert(new_data.dx == 0 || std::abs(reader.x() + new_data.dx - line.x()) < 0.00001f); + assert(new_data.dy == 0 || reader.y() == new_data.y); + assert(new_data.dy == 0 || std::abs(reader.y() + new_data.dy - line.y()) < 0.00001f); + assert(new_data.de == 0 || (relative_e?0:reader.e()) == new_data.e); + assert(new_data.de == 0 || std::abs((relative_e?0.f:reader.e()) + new_data.de - line.e()) < 0.00001f); + //assert(new_data.de == 0 ||(relative_e?0.f:reader.e()) + new_data.de == line.e()); if (m_current_kickstart.time > 0 && time > 0) { m_current_kickstart.time -= time;