mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 18:59:02 +08:00
Fix rotation for threaded perls
This commit is contained in:
parent
124a1fd84e
commit
e91320e031
@ -724,9 +724,10 @@ sub make_thumbnail {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($obj_idx) = @_;
|
my ($obj_idx) = @_;
|
||||||
|
|
||||||
|
my $object = $self->{objects}[$obj_idx];
|
||||||
|
$object->thumbnail_scaling_factor($self->{scaling_factor});
|
||||||
my $cb = sub {
|
my $cb = sub {
|
||||||
my $object = $self->{objects}[$obj_idx];
|
my $thumbnail = $object->make_thumbnail;
|
||||||
my $thumbnail = $object->make_thumbnail(scaling_factor => $self->{scaling_factor});
|
|
||||||
|
|
||||||
if ($Slic3r::have_threads) {
|
if ($Slic3r::have_threads) {
|
||||||
Wx::PostEvent($self, Wx::PlThreadEvent->new(-1, $THUMBNAIL_DONE_EVENT, shared_clone([ $obj_idx, $thumbnail ])));
|
Wx::PostEvent($self, Wx::PlThreadEvent->new(-1, $THUMBNAIL_DONE_EVENT, shared_clone([ $obj_idx, $thumbnail ])));
|
||||||
@ -1111,13 +1112,11 @@ sub instances_count {
|
|||||||
|
|
||||||
sub make_thumbnail {
|
sub make_thumbnail {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my %params = @_;
|
|
||||||
|
|
||||||
my @points = map [ @$_[X,Y] ], @{$self->model_object->mesh->vertices};
|
my @points = map [ @$_[X,Y] ], @{$self->model_object->mesh->vertices};
|
||||||
my $convex_hull = Slic3r::Polygon->new(convex_hull(\@points));
|
my $convex_hull = Slic3r::Polygon->new(convex_hull(\@points));
|
||||||
$self->thumbnail_scaling_factor($params{scaling_factor});
|
|
||||||
for (@$convex_hull) {
|
for (@$convex_hull) {
|
||||||
@$_ = map $_ * $params{scaling_factor}, @$_;
|
@$_ = map $_ * $self->thumbnail_scaling_factor, @$_;
|
||||||
}
|
}
|
||||||
$convex_hull->simplify(0.3);
|
$convex_hull->simplify(0.3);
|
||||||
$convex_hull->rotate(Slic3r::Geometry::deg2rad($self->rotate));
|
$convex_hull->rotate(Slic3r::Geometry::deg2rad($self->rotate));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user