mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	One more speed optimization in STL.pm
This commit is contained in:
		
							parent
							
								
									745cea8e6c
								
							
						
					
					
						commit
						e51dbb994d
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -48,7 +48,7 @@ sub read_file {
 | 
			
		|||
sub _read_ascii {
 | 
			
		||||
    my ($fh, $facets, $vertices) = @_;
 | 
			
		||||
    
 | 
			
		||||
    my $point_re = qr/([^ ]+)\s+([^ ]+)\s+([^ ]+)/;
 | 
			
		||||
    my $point_re = qr/(([^ ]+)\s+([^ ]+)\s+([^ ]+))/;
 | 
			
		||||
    
 | 
			
		||||
    my $facet;
 | 
			
		||||
    my %vertices_map = ();
 | 
			
		||||
| 
						 | 
				
			
			@ -63,12 +63,12 @@ sub _read_ascii {
 | 
			
		|||
                undef $facet;
 | 
			
		||||
            } else {
 | 
			
		||||
                /^\s*vertex\s+$point_re/o or next;
 | 
			
		||||
                my $vertex_id = join ',', $1, $2, $3;
 | 
			
		||||
                my $vertex_id = $1;
 | 
			
		||||
                my $vertex_idx;
 | 
			
		||||
                if (exists $vertices_map{$vertex_id}) {
 | 
			
		||||
                    $vertex_idx = $vertices_map{$vertex_id};
 | 
			
		||||
                } else {
 | 
			
		||||
                    push @$vertices, [map $_ * 1, $1, $2, $3];
 | 
			
		||||
                    push @$vertices, [map $_ * 1, $2, $3, $4];
 | 
			
		||||
                    $vertex_idx = $vertices_map{$vertex_id} = $#$vertices;
 | 
			
		||||
                }
 | 
			
		||||
                push @$facet, $vertex_idx;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue