mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	One minor optimization in GCode.pm
This commit is contained in:
		
							parent
							
								
									5f17fa342b
								
							
						
					
					
						commit
						70d824c9a7
					
				
					 1 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -553,8 +553,16 @@ sub unretract {
 | 
			
		|||
    my $to_unretract = $self->extruder->retracted + $self->extruder->restart_extra;
 | 
			
		||||
    if ($to_unretract) {
 | 
			
		||||
        $self->speed('retract');
 | 
			
		||||
        # use G1 instead of G0 because G0 will blend the restart with the previous travel move
 | 
			
		||||
        $gcode .= $self->G1(undef, undef, $to_unretract, "compensate retraction");
 | 
			
		||||
        if ($self->config->extrusion_axis) {
 | 
			
		||||
            $self->extruder->e(0) if $self->config->use_relative_e_distances;
 | 
			
		||||
            $self->total_extrusion_length($self->total_extrusion_length + $to_unretract);
 | 
			
		||||
            # use G1 instead of G0 because G0 will blend the restart with the previous travel move
 | 
			
		||||
            $gcode .= sprintf "G1 E%.5f F%.3f",
 | 
			
		||||
                $self->extruder->e($self->extruder->e + $to_unretract),
 | 
			
		||||
                $self->extruder->retract_speed_mm_min;
 | 
			
		||||
            $gcode .= " ; compensate retraction" if $self->config->gcode_comments;
 | 
			
		||||
            $gcode .= "\n";
 | 
			
		||||
        }
 | 
			
		||||
        $self->extruder->retracted(0);
 | 
			
		||||
        $self->extruder->restart_extra(0);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue