mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Bugfix: crash when using non-consecutive extruders. #1808
This commit is contained in:
		
							parent
							
								
									9ec7ae08ad
								
							
						
					
					
						commit
						71322cc49d
					
				
					 2 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
					@ -228,7 +228,7 @@ sub init_extruders {
 | 
				
			||||||
        (map $self->config->get("${_}_extruder")-1, qw(perimeter infill support_material support_material_interface)),
 | 
					        (map $self->config->get("${_}_extruder")-1, qw(perimeter infill support_material support_material_interface)),
 | 
				
			||||||
        (values %extruder_mapping),
 | 
					        (values %extruder_mapping),
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
    for my $extruder_id (keys %{{ map {$_ => 1} @used_extruders }}) {
 | 
					    for my $extruder_id (0 .. max(@used_extruders)) {
 | 
				
			||||||
        $self->extruders->[$extruder_id] = Slic3r::Extruder->new(
 | 
					        $self->extruders->[$extruder_id] = Slic3r::Extruder->new(
 | 
				
			||||||
            config => $self->config,
 | 
					            config => $self->config,
 | 
				
			||||||
            id => $extruder_id,
 | 
					            id => $extruder_id,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										10
									
								
								t/multi.t
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								t/multi.t
									
										
									
									
									
								
							| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
use Test::More tests => 1;
 | 
					use Test::More tests => 2;
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
use warnings;
 | 
					use warnings;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -59,4 +59,12 @@ use Slic3r::Test;
 | 
				
			||||||
    ok !(first { $convex_hull->encloses_point($_) } @toolchange_points), 'all toolchanges happen outside skirt';
 | 
					    ok !(first { $convex_hull->encloses_point($_) } @toolchange_points), 'all toolchanges happen outside skirt';
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    my $config = Slic3r::Config->new_from_defaults;
 | 
				
			||||||
 | 
					    $config->set('support_material_extruder', 3);
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
 | 
				
			||||||
 | 
					    ok Slic3r::Test::gcode($print), 'no errors when using non-consecutive extruders';
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__END__
 | 
					__END__
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue