mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-06-20 14:41:05 +08:00
Minor fix (still no thumbnail)
This commit is contained in:
parent
ee5b999ab0
commit
4bf08cbdec
@ -1327,20 +1327,19 @@ sub make_thumbnail {
|
|||||||
my $mesh = $self->get_model_object->mesh; # $self->model_object is already aligned to origin
|
my $mesh = $self->get_model_object->mesh; # $self->model_object is already aligned to origin
|
||||||
my $thumbnail = Slic3r::ExPolygon::Collection->new;
|
my $thumbnail = Slic3r::ExPolygon::Collection->new;
|
||||||
if (@{$mesh->facets} <= 5000) {
|
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 {
|
} else {
|
||||||
my $convex_hull = Slic3r::ExPolygon->new($self->convex_hull)->clone;
|
my $convex_hull = Slic3r::ExPolygon->new($self->convex_hull)->clone;
|
||||||
$convex_hull->scale(1/&Slic3r::SCALING_FACTOR);
|
$convex_hull->scale(1/&Slic3r::SCALING_FACTOR);
|
||||||
$thumbnail->append($convex_hull);
|
$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);
|
$thumbnail->scale(&Slic3r::SCALING_FACTOR);
|
||||||
$self->thumbnail($thumbnail); # ignored in multi-threaded environments
|
$self->thumbnail($thumbnail); # ignored in multi-threaded environments
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user