Reapply correct optimization for simplifiying fill_surfaces before performing the offset. #1325

This commit is contained in:
Alessandro Ranellucci 2013-07-20 12:22:41 +02:00
parent 9433048873
commit e29aca3553
5 changed files with 40 additions and 12 deletions

View file

@ -145,15 +145,21 @@ sub clip_line {
return Boost::Geometry::Utils::polygon_multi_linestring_intersection($self, [$line]);
}
sub simplify {
sub simplify_as_polygons {
my $self = shift;
my ($tolerance) = @_;
# it would be nice to have a multilinestring_simplify method in B::G::U
my @simplified = Slic3r::Geometry::Clipper::simplify_polygons(
return Slic3r::Geometry::Clipper::simplify_polygons(
[ map Boost::Geometry::Utils::linestring_simplify($_, $tolerance), @$self ],
);
return @{ Slic3r::Geometry::Clipper::union_ex([ @simplified ]) };
}
sub simplify {
my $self = shift;
my ($tolerance) = @_;
return @{ Slic3r::Geometry::Clipper::union_ex([ $self->simplify_as_polygons($tolerance) ]) };
}
sub scale {