ENH: don't generate detour travel when position is unclear

Detour travel is wrong in multi color printing when
current position is unclear.

Don't generate detour travel in this case to avoid
colour mixture.

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: I2d24b04d99b8a0b34a46c9f88e522e97cb0fe354
This commit is contained in:
salt.wei 2022-12-26 18:01:20 +08:00 committed by Lane.Wei
parent 12590a3599
commit 9f4a54d280
1 changed files with 3 additions and 1 deletions

View File

@ -3777,7 +3777,9 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string
// multi-hop travel path inside the configuration space
if (needs_retraction
&& m_config.reduce_crossing_wall
&& ! m_avoid_crossing_perimeters.disabled_once()) {
&& ! m_avoid_crossing_perimeters.disabled_once()
//BBS: don't generate detour travel paths when current position is unclear
&& m_writer.is_current_position_clear()) {
travel = m_avoid_crossing_perimeters.travel_to(*this, point, &could_be_wipe_disabled);
// check again whether the new travel path still needs a retraction
needs_retraction = this->needs_retraction(travel, role);