Disallow enabling options avoid_crossing_perimeters and

avoid_curled_filament_during_travels at the same time,
throw warning if both options enabled together - in this case ignore curled filament avoidance
This commit is contained in:
PavelMikus 2022-12-12 11:33:28 +01:00
parent fc929d9faf
commit 30e81fad3b
2 changed files with 11 additions and 3 deletions

View file

@ -3002,9 +3002,14 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string
Polyline travel { this->last_pos(), point };
if (this->config().avoid_curled_filament_during_travels) {
Point scaled_origin = Point(scaled(this->origin()));
travel = m_avoid_curled_filaments.find_path(this->last_pos() + scaled_origin, point + scaled_origin);
travel.translate(-scaled_origin);
if (m_config.avoid_crossing_perimeters) {
BOOST_LOG_TRIVIAL(warning)
<< "Option >avoid curled filament during travels< is not compatible with avoid crossing perimeters and it will be ignored!";
} else {
Point scaled_origin = Point(scaled(this->origin()));
travel = m_avoid_curled_filaments.find_path(this->last_pos() + scaled_origin, point + scaled_origin);
travel.translate(-scaled_origin);
}
}
// check whether a straight travel move would need retraction