Bugfix: is_printable() wasn't discarding narrow ring-shaped top/bottom surfaces because it was only considering the contour. This caused extra shell material even in hollow prints. #1049

This commit is contained in:
Alessandro Ranellucci 2013-03-30 11:22:12 +01:00
parent 7f23e72a10
commit 04d2231901
4 changed files with 14 additions and 5 deletions

View file

@ -62,6 +62,17 @@ sub is_valid {
&& (!first { $_->is_counter_clockwise } $self->holes);
}
# returns false if the expolygon is too tight to be printed
sub is_printable {
my $self = shift;
my ($width) = @_;
# try to get an inwards offset
# for a distance equal to half of the extrusion width;
# if no offset is possible, then expolygon is not printable.
return Slic3r::Geometry::Clipper::offset($self, -$width / 2) ? 1 : 0;
}
sub boost_polygon {
my $self = shift;
return Boost::Geometry::Utils::polygon(@$self);