mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 13:17:54 -06:00
use remove_coinciding_points before convex_hull
convex_hull returns polygons with sharp concaves sometimes when duplicate points are present
This commit is contained in:
parent
02b11fb49a
commit
4b91496edd
2 changed files with 5 additions and 2 deletions
|
@ -999,7 +999,7 @@ package Slic3r::GUI::Plater::Object;
|
|||
use Moo;
|
||||
|
||||
use Math::ConvexHull qw(convex_hull);
|
||||
use Slic3r::Geometry qw(X Y);
|
||||
use Slic3r::Geometry qw(X Y remove_coinciding_points);
|
||||
|
||||
has 'name' => (is => 'rw', required => 1);
|
||||
has 'input_file' => (is => 'rw', required => 1);
|
||||
|
@ -1034,6 +1034,7 @@ sub make_thumbnail {
|
|||
my %params = @_;
|
||||
|
||||
my @points = map [ @$_[X,Y] ], @{$self->mesh->vertices};
|
||||
remove_coinciding_points(\@points);
|
||||
my $convex_hull = Slic3r::Polygon->new(convex_hull(\@points));
|
||||
for (@$convex_hull) {
|
||||
@$_ = map $_ * $params{scaling_factor}, @$_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue