extruder: Do extruder lookahead based on time instead of cornering

When calculating the extruder lookahead, determine how far to
lookahead by the amount of elapsed time each move takes.  This makes
the extruder lookahead code more flexible as it is no longer limited
to the next immediate cornering moves.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-01-27 22:32:12 -05:00
parent 1bb7a22115
commit 528c29c01c
2 changed files with 37 additions and 40 deletions

View file

@ -125,7 +125,7 @@ class MoveQueue:
for move, start_v2, cruise_v2, end_v2 in move_info[:flush_count]:
move.set_junction(start_v2, cruise_v2, end_v2)
# Allow extruder to do its lookahead
flush_count = self.extruder_lookahead(move_info, flush_count, lazy)
flush_count = self.extruder_lookahead(queue, flush_count, lazy)
# Generate step times for all moves ready to be flushed
for move in queue[:flush_count]:
move.move()