mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Fixed split_stl.pl
This commit is contained in:
		
							parent
							
								
									30fa055995
								
							
						
					
					
						commit
						5902c65014
					
				
					 1 changed files with 8 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -30,11 +30,16 @@ my %opt = ();
 | 
			
		|||
    $basename =~ s/\.stl$//i;
 | 
			
		||||
    
 | 
			
		||||
    my $part_count = 0;
 | 
			
		||||
    foreach my $new_mesh ($model->mesh->split_mesh) {
 | 
			
		||||
    my $mesh = $model->objects->[0]->volumes->[0]->mesh;
 | 
			
		||||
    foreach my $new_mesh (@{$mesh->split}) {
 | 
			
		||||
        $new_mesh->repair;
 | 
			
		||||
        
 | 
			
		||||
        my $new_model = Slic3r::Model->new;
 | 
			
		||||
        $new_model
 | 
			
		||||
            ->add_object(vertices   => $new_mesh->vertices)
 | 
			
		||||
            ->add_volume(facets     => $new_mesh->facets);
 | 
			
		||||
            ->add_object()
 | 
			
		||||
            ->add_volume(mesh => $new_mesh);
 | 
			
		||||
        
 | 
			
		||||
        $new_model->add_default_instances;
 | 
			
		||||
        
 | 
			
		||||
        my $output_file = sprintf '%s_%02d.stl', $basename, ++$part_count;
 | 
			
		||||
        printf "Writing to %s\n", basename($output_file);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue