From e51dbb994d7c9c395aa67bffb6e146819a9210bc Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 14 May 2013 14:17:46 +0200 Subject: [PATCH] One more speed optimization in STL.pm --- lib/Slic3r/Format/STL.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/Format/STL.pm b/lib/Slic3r/Format/STL.pm index 6b103cbdc..0d0331c85 100644 --- a/lib/Slic3r/Format/STL.pm +++ b/lib/Slic3r/Format/STL.pm @@ -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;