ENH: wipe_distance should not to be 0 or negative value

As title, fix github issue #220

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: If63c839da1341ac2e16bbfa287c4e32564284d59
This commit is contained in:
salt.wei 2022-09-07 16:26:45 +08:00 committed by Lane.Wei
parent e6f0c5abec
commit 4e1caa428d
4 changed files with 9 additions and 8 deletions

View file

@ -3836,8 +3836,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);
}