Add travel_slope option (#5873)

* Add travel_slope option

* Merge branch 'main' into travel-slope-pr
This commit is contained in:
Vovodroid 2024-06-29 12:33:22 +03:00 committed by GitHub
parent f5c5f322d2
commit a13152c61f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 30 additions and 12 deletions

View file

@ -5894,7 +5894,7 @@ bool GCode::needs_retraction(const Polyline &travel, ExtrusionRole role, LiftTyp
float max_z_hop = 0.f;
for (int i = 0; i < m_config.z_hop.size(); i++)
max_z_hop = std::max(max_z_hop, (float)m_config.z_hop.get_at(i));
float travel_len_thresh = scale_(max_z_hop / tan(GCodeWriter::slope_threshold));
float travel_len_thresh = scale_(max_z_hop / tan(this->writer().extruder()->travel_slope()));
float accum_len = 0.f;
Polyline clipped_travel;