From 33a4ec660d51162b1f7bd25cbe346dfc606a92f1 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 30 Mar 2013 00:47:13 +0100 Subject: [PATCH] better handling of too-small and too-short models #929. These changes handle small models better in the plater preview. Extremely small thumbnails are preserved instead of culled, allowing the model to be scaled up. The scale range is extended to 100000% to allow mm-scale objects expressed in meters to be opened and scaled to mm. Original coding by mesheldrake --- lib/Slic3r/GUI/Plater.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index ba527324af..bd1fa29649 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -437,7 +437,7 @@ sub changescale { my ($obj_idx, $object) = $self->selected_object; # max scale factor should be above 2540 to allow importing files exported in inches - my $scale = Wx::GetNumberFromUser("", "Enter the scale % for the selected object:", "Scale", $object->scale*100, 0, 5000, $self); + my $scale = Wx::GetNumberFromUser("", "Enter the scale % for the selected object:", "Scale", $object->scale*100, 0, 100000, $self); return if !$scale || $scale == -1; $self->{list}->SetItem($obj_idx, 2, "$scale%"); @@ -861,7 +861,7 @@ sub repaint { @{$parent->{object_previews}} = (); for my $obj_idx (0 .. $#{$parent->{objects}}) { my $object = $parent->{objects}[$obj_idx]; - next unless $object->thumbnail; + next unless $object->thumbnail && @{$object->thumbnail->expolygons}; for my $instance_idx (0 .. $#{$object->instances}) { my $instance = $object->instances->[$instance_idx]; push @{$parent->{object_previews}}, [ $obj_idx, $instance_idx, $object->thumbnail->clone ];