Skip to content

Commit

Permalink
Fixed minimum layer time application regression
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Nov 23, 2023
1 parent a336b22 commit 65f0d9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/ExtruderPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ExtruderPlan
FRIEND_TEST(ExtruderPlanTest, BackPressureCompensationEmptyPlan);
#endif
public:
size_t extruder_nr_; //!< The extruder used for this paths in the current plan.
size_t extruder_nr_{ 0 }; //!< The extruder used for this paths in the current plan.

ExtruderPlan() noexcept = default;

Expand Down
2 changes: 1 addition & 1 deletion src/LayerPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,7 @@ void ExtruderPlan::forceMinimalLayerTime(double minTime, double time_other_extr_
// Slowing down to the slowest_speed is sufficient to respect the minimum layer time.
// Linear interpolate between extrudeTime and total_extrude_time_at_slowest_speed
const double factor = (1 / total_extrude_time_at_slowest_speed - 1 / minExtrudeTime) / (1 / total_extrude_time_at_slowest_speed - 1 / extrudeTime);
slow_down_func = [&slowest_path_speed = slowest_path_speed_, &factor](const GCodePath& path)
slow_down_func = [&slowest_path_speed = slowest_path_speed_, factor](const GCodePath& path)
{
const double actual_target_speed = slowest_path_speed * (1.0 - factor) + (path.config.getSpeed() * path.speed_factor) * factor;
return std::min(actual_target_speed / (path.config.getSpeed() * path.speed_factor), 1.0);
Expand Down

0 comments on commit 65f0d9b

Please sign in to comment.