mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 13:02:39 -07: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:
@@ -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__
|
||||
|
||||
@@ -31,10 +31,6 @@
|
||||
Polygons simplify_p(double tolerance);
|
||||
Polylines medial_axis(double max_width, double min_width)
|
||||
%code{% THIS->medial_axis(max_width, min_width, &RETVAL); %};
|
||||
Polygons get_trapezoids2(double angle)
|
||||
%code{% THIS->get_trapezoids2(&RETVAL, angle); %};
|
||||
Polygons triangulate()
|
||||
%code{% THIS->triangulate(&RETVAL); %};
|
||||
%{
|
||||
|
||||
ExPolygon*
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
%code%{ RETVAL = &THIS->thin_fills; %};
|
||||
Ref<SurfaceCollection> fill_surfaces()
|
||||
%code%{ RETVAL = &THIS->fill_surfaces; %};
|
||||
Polygons bridged()
|
||||
%code%{ RETVAL = THIS->bridged; %};
|
||||
Ref<ExtrusionEntityCollection> perimeters()
|
||||
%code%{ RETVAL = &THIS->perimeters; %};
|
||||
Ref<ExtrusionEntityCollection> fills()
|
||||
|
||||
Reference in New Issue
Block a user