mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-10-11 14:22:54 +02:00
Removal of not numerically robust libraries "poly2tree" and "polypartition".
Adjustment of GUI/3DBed.cpp,hpp to use the more stable triangulation algoritm derived from SGI glut. Fix of an extremely slow bridging calculation, caused by an extremely slow bridged area detection function, of which the results were never used. Fixes "slicing fails or takes too long #5974"
This commit is contained in:
1 parent
820c18923b
commit
2e55898d78
33 files changed
+94
-5126
No files matched your search
+1
-29
@@ -5,7 +5,7 @@ use warnings;
|
||||
|
||||
use List::Util qw(first sum);
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 31;
|
||||
use Test::More tests => 21;
|
||||
|
||||
use constant PI => 4 * atan2(1, 1);
|
||||
|
||||
@@ -105,32 +105,4 @@ is $expolygon->area, 100*100-20*20, 'area';
|
||||
is_deeply $collection->[0]->clone->pp, $collection->[0]->pp, 'clone collection item';
|
||||
}
|
||||
|
||||
{
|
||||
my $expolygon = Slic3r::ExPolygon->new($square);
|
||||
my $polygons = $expolygon->get_trapezoids2(PI/2);
|
||||
is scalar(@$polygons), 1, 'correct number of trapezoids returned';
|
||||
is scalar(@{$polygons->[0]}), 4, 'trapezoid has 4 points';
|
||||
is $polygons->[0]->area, $expolygon->area, 'trapezoid has correct area';
|
||||
}
|
||||
|
||||
{
|
||||
my $polygons = $expolygon->get_trapezoids2(PI/2);
|
||||
is scalar(@$polygons), 4, 'correct number of trapezoids returned';
|
||||
|
||||
# trapezoid polygons might have more than 4 points in case of collinear segments
|
||||
$polygons = [ map @{$_->simplify(1)}, @$polygons ];
|
||||
ok !defined(first { @$_ != 4 } @$polygons), 'all trapezoids have 4 points';
|
||||
|
||||
is scalar(grep { $_->area == 40*100 } @$polygons), 2, 'trapezoids have expected area';
|
||||
is scalar(grep { $_->area == 20*40 } @$polygons), 2, 'trapezoids have expected area';
|
||||
}
|
||||
|
||||
{
|
||||
my $expolygon = Slic3r::ExPolygon->new([ [0,100],[100,0],[200,0],[300,100],[200,200],[100,200] ]);
|
||||
my $polygons = $expolygon->get_trapezoids2(PI/2);
|
||||
is scalar(@$polygons), 3, 'correct number of trapezoids returned';
|
||||
is scalar(grep { $_->area == 100*200/2 } @$polygons), 2, 'trapezoids have expected area';
|
||||
is scalar(grep { $_->area == 100*200 } @$polygons), 1, 'trapezoids have expected area';
|
||||
}
|
||||
|
||||
__END__
|
||||
Reference in new issue
Block a user