mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-17 03:15:54 +08:00
Don't fake unretract after M600 but reset the retraction data properly.
supermerill/SuperSlicer#2295
This commit is contained in:
parent
d423e303e3
commit
994997ab90
@ -77,6 +77,14 @@ double Tool::unretract()
|
|||||||
return dE;
|
return dE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Called after a M600 or somethgin like that, so you don't have to unretract, but the absolute position won't change.
|
||||||
|
void Tool::reset_retract() {
|
||||||
|
m_retracted = 0.;
|
||||||
|
m_restart_extra = 0.;
|
||||||
|
if (m_restart_extra_toolchange != 0)
|
||||||
|
m_restart_extra_toolchange = 0.;
|
||||||
|
}
|
||||||
|
|
||||||
// Used filament volume in mm^3.
|
// Used filament volume in mm^3.
|
||||||
double Tool::extruded_volume() const
|
double Tool::extruded_volume() const
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,7 @@ public:
|
|||||||
virtual double extrude(double dE);
|
virtual double extrude(double dE);
|
||||||
virtual double retract(double length, double restart_extra, double restart_extra_from_toolchange);
|
virtual double retract(double length, double restart_extra, double restart_extra_from_toolchange);
|
||||||
virtual double unretract();
|
virtual double unretract();
|
||||||
|
virtual void reset_retract();
|
||||||
double E() const { return m_E; }
|
double E() const { return m_E; }
|
||||||
void reset_E() { m_E = 0.; }
|
void reset_E() { m_E = 0.; }
|
||||||
double e_per_mm(double mm3_per_mm) const { return mm3_per_mm * m_e_per_mm3; }
|
double e_per_mm(double mm3_per_mm) const { return mm3_per_mm * m_e_per_mm3; }
|
||||||
|
@ -1576,7 +1576,7 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ensure the first tool doesn't "extra_retract"
|
// ensure the first tool doesn't "extra_retract"
|
||||||
m_writer.unretract();
|
m_writer.tool()->reset_retract();
|
||||||
|
|
||||||
//write temps after custom gcodes to ensure the temperature are good. (after tool selection)
|
//write temps after custom gcodes to ensure the temperature are good. (after tool selection)
|
||||||
if ((initial_extruder_id != (uint16_t)-1) && !this->config().start_gcode_manual && print.config().first_layer_temperature.get_at(initial_extruder_id) != 0)
|
if ((initial_extruder_id != (uint16_t)-1) && !this->config().start_gcode_manual && print.config().first_layer_temperature.get_at(initial_extruder_id) != 0)
|
||||||
@ -2162,7 +2162,8 @@ std::string GCode::emit_custom_gcode_per_print_z(
|
|||||||
//FIXME Tell G-code writer that M600 filled the extruder, thus the G-code writer shall reset the extruder to unretracted state after
|
//FIXME Tell G-code writer that M600 filled the extruder, thus the G-code writer shall reset the extruder to unretracted state after
|
||||||
// return from M600. Thus the G-code generated by the following line is ignored.
|
// return from M600. Thus the G-code generated by the following line is ignored.
|
||||||
// see GH issue #6362
|
// see GH issue #6362
|
||||||
gcodegen.writer().unretract();
|
// merill: don't unretract, as it create problem on absolute position. Clear the retraction properley, plz.
|
||||||
|
gcodegen.writer().tool()->reset_retract();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (gcode_type == CustomGCode::PausePrint) // Pause print
|
if (gcode_type == CustomGCode::PausePrint) // Pause print
|
||||||
|
Loading…
x
Reference in New Issue
Block a user