Better tracking of extrusion and position in consideration of relative moves

Reset position tracking correctly for G92 s
Render G92 instructions correctly (don't show as filament change)
Remove dead code

issue: MatterHackers/MCCentral#4688
Don't force tool change on layer change
This commit is contained in:
Lars Brubaker 2018-12-11 14:10:27 -08:00
parent 5e1cbf7db0
commit e9c4ba5d28
7 changed files with 93 additions and 59 deletions

View file

@ -113,10 +113,16 @@ namespace MatterHackers.GCodeVisualizer
if (currentInstruction.Position == previousInstruction.Position)
{
if (Math.Abs(currentInstruction.EPosition - previousInstruction.EPosition) > 0)
double eMovement = 0;
if (currentInstruction.PositionSet != PositionSet.E)
{
eMovement = currentInstruction.EPosition - previousInstruction.EPosition;
}
if (Math.Abs(eMovement) > 0)
{
// this is a retraction
renderFeaturesForLayer.Add(new RenderFeatureRetract(currentInstruction.Position, currentInstruction.EPosition - previousInstruction.EPosition, currentInstruction.ExtruderIndex, currentInstruction.FeedRate));
renderFeaturesForLayer.Add(new RenderFeatureRetract(currentInstruction.Position, eMovement, currentInstruction.ExtruderIndex, currentInstruction.FeedRate));
}
if (currentInstruction.Line.StartsWith("G10"))
{