Faster support generation. Includes a new implementation of the Douglas-Peucker algorithm

This commit is contained in:
Alessandro Ranellucci 2012-02-25 14:46:21 +01:00
parent 94e673e050
commit eba7c10018
9 changed files with 166 additions and 183 deletions

View file

@ -57,7 +57,7 @@ sub simplify {
my $self = shift;
my $tolerance = shift || 10;
@$self = Slic3r::Geometry::Douglas_Peucker($self, $tolerance);
@$self = @{ Slic3r::Geometry::douglas_peucker($self, $tolerance) };
bless $_, 'Slic3r::Point' for @$self;
}
@ -110,6 +110,9 @@ sub clip_with_expolygon {
my $self = shift;
my ($expolygon) = @_;
#printf "Clipping polyline of %d points to expolygon of %d polygons and %d points\n",
# scalar(@$self), scalar(@$expolygon), scalar(map @$_, @$expolygon);
my @polylines = ();
my $current_polyline = [];
foreach my $line ($self->lines) {