mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Parse and write multi-material AMF files. Convert multiple STL files into a single multi-material AMF
This commit is contained in:
		
							parent
							
								
									aa98a9deb2
								
							
						
					
					
						commit
						b6bffacb9d
					
				
					 5 changed files with 97 additions and 33 deletions
				
			
		|  | @ -25,14 +25,16 @@ sub go { | |||
|     # each layer has surfaces with holes | ||||
|     $self->status_cb->(10, "Processing triangulated mesh"); | ||||
|     my $print; | ||||
|     { | ||||
|         my $mesh = $self->input_file =~ /\.stl$/i | ||||
|             ? Slic3r::STL->read_file($self->input_file) | ||||
|             : $self->input_file =~ /\.amf(\.xml)?$/i | ||||
|                 ? Slic3r::AMF->read_file($self->input_file) | ||||
|                 : die "Input file must have .stl or .amf(.xml) extension\n"; | ||||
|     if ($self->input_file =~ /\.stl$/i) { | ||||
|         my $mesh = Slic3r::STL->read_file($self->input_file); | ||||
|         $mesh->check_manifoldness; | ||||
|         $print = Slic3r::Print->new_from_mesh($mesh); | ||||
|     } elsif ( $self->input_file =~ /\.amf(\.xml)?$/i) { | ||||
|         my ($materials, $meshes_by_material) = Slic3r::AMF->read_file($self->input_file); | ||||
|         $_->check_manifoldness for values %$meshes_by_material; | ||||
|         $print = Slic3r::Print->new_from_mesh($meshes_by_material->{_} || +(values %$meshes_by_material)[0]); | ||||
|     } else { | ||||
|         die "Input file must have .stl or .amf(.xml) extension\n"; | ||||
|     } | ||||
|      | ||||
|     # make perimeters | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci