Bugfix: pillars support material crashed when no overhangs were detected

This commit is contained in:
Alessandro Ranellucci 2014-04-07 15:24:17 +02:00
parent 1c020eda78
commit 93a7d87fc6
2 changed files with 6 additions and 1 deletions

View file

@ -647,6 +647,9 @@ sub generate_toolpaths {
sub generate_pillars_shape {
my ($self, $contact, $support_z, $shape) = @_;
# this prevents supplying an empty point set to BoundingBox constructor
return if !%$contact;
my $pillar_size = scale PILLAR_SIZE;
my $pillar_spacing = scale PILLAR_SPACING;
@ -658,7 +661,7 @@ sub generate_pillars_shape {
[$pillar_size, $pillar_size],
[0, $pillar_size],
);
my @pillars = ();
my $bb = Slic3r::Geometry::BoundingBox->new_from_points([ map @$_, map @$_, values %$contact ]);
for (my $x = $bb->x_min; $x <= $bb->x_max-$pillar_size; $x += $pillar_spacing) {