mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 13:02:39 -07:00
Bugfix: medial axis missed some segments. #2144
This commit is contained in:
16
t/thin.t
16
t/thin.t
@@ -1,4 +1,4 @@
|
||||
use Test::More tests => 13;
|
||||
use Test::More tests => 14;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
@@ -8,7 +8,7 @@ BEGIN {
|
||||
}
|
||||
|
||||
use Slic3r;
|
||||
use List::Util qw(first);
|
||||
use List::Util qw(first sum);
|
||||
use Slic3r::Geometry qw(epsilon scale unscale scaled_epsilon Y);
|
||||
use Slic3r::Test;
|
||||
|
||||
@@ -121,4 +121,16 @@ if (0) {
|
||||
ok $len > 80*2 && $len < 100*2, 'medial axis has reasonable length';
|
||||
}
|
||||
|
||||
{
|
||||
my $expolygon = Slic3r::ExPolygon->new(Slic3r::Polygon->new(
|
||||
[-203064906,-51459966],[-219312231,-51459966],[-219335477,-51459962],[-219376095,-51459962],[-219412047,-51459966],
|
||||
[-219572094,-51459966],[-219624814,-51459962],[-219642183,-51459962],[-219656665,-51459966],[-220815482,-51459966],
|
||||
[-220815482,-37738966],[-221117540,-37738966],[-221117540,-51762024],[-203064906,-51762024],
|
||||
));
|
||||
my $polylines = $expolygon->medial_axis(819998, 102499.75);
|
||||
|
||||
my $perimeter = $expolygon->contour->split_at_first_point->length;
|
||||
ok sum(map $_->length, @$polylines) > $perimeter/2/4*3, 'medial axis has a reasonable length';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
||||
Reference in New Issue
Block a user