From 4bf08cbdec3780ac0895b35dba44fdec7a232910 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 25 Aug 2013 22:33:50 +0200 Subject: [PATCH] Minor fix (still no thumbnail) --- lib/Slic3r/GUI/Plater.pm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index eb030e43c..52402e211 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -1327,20 +1327,19 @@ sub make_thumbnail { my $mesh = $self->get_model_object->mesh; # $self->model_object is already aligned to origin my $thumbnail = Slic3r::ExPolygon::Collection->new; if (@{$mesh->facets} <= 5000) { - $thumbnail->append(@{ $mesh->horizontal_projection }); + # remove polygons with area <= 1mm + my $area_threshold = Slic3r::Geometry::scale 1; + $thumbnail->append( + map $_->simplify(0.5), + grep $_->area >= $area_threshold, + @{ $mesh->horizontal_projection }, + ); } else { my $convex_hull = Slic3r::ExPolygon->new($self->convex_hull)->clone; $convex_hull->scale(1/&Slic3r::SCALING_FACTOR); $thumbnail->append($convex_hull); } - # remove polygons with area <= 1mm - my $area_threshold = Slic3r::Geometry::scale 1; - @{$thumbnail->expolygons} = - map $_->simplify(0.5), - grep $_->area >= $area_threshold, - @{$thumbnail->expolygons}; - $thumbnail->scale(&Slic3r::SCALING_FACTOR); $self->thumbnail($thumbnail); # ignored in multi-threaded environments