Bugfix: some regions near bridges were left blank.

This commit is contained in:
Alessandro Ranellucci 2011-11-21 21:05:00 +01:00
parent 36e1ea0caa
commit 84d9f5fd9d
2 changed files with 11 additions and 22 deletions

View file

@ -218,7 +218,7 @@ sub make_surfaces {
} }
$next_lines $next_lines
or die sprintf("No lines start at point %s. This shouldn't happen. Please check the model for manifoldness.", $get_point_id->($points[-1])); or die sprintf("No lines start at point %s. This shouldn't happen. Please check the model for manifoldness.\n", $get_point_id->($points[-1]));
last CYCLE if !@$next_lines; last CYCLE if !@$next_lines;
my @ordered_next_lines = sort my @ordered_next_lines = sort
@ -300,7 +300,7 @@ sub make_surfaces {
warn $@ if $@; warn $@ if $@;
if (@discarded_lines) { if (@discarded_lines) {
print " Warning: even slow detection algorithm throwed errors. Review the output before printing.\n"; print " Warning: even slow detection algorithm threw errors. Review the output before printing.\n";
} }
} }
@ -449,7 +449,8 @@ sub process_bridges {
my $unique_type = sub { $_[0]->surface_type . "_" . ($_[0]->bridge_angle || '') }; my $unique_type = sub { $_[0]->surface_type . "_" . ($_[0]->bridge_angle || '') };
my @unique_types = (); my @unique_types = ();
foreach my $bridge (@{$self->bridges}) { foreach my $bridge (@{$self->bridges}) {
push @unique_types, $unique_type->($bridge); my $type = $unique_type->($bridge);
push @unique_types, $type unless grep $_ eq $type, @unique_types;
} }
# merge bridges of the same type, removing any of the bridges already merged; # merge bridges of the same type, removing any of the bridges already merged;

View file

@ -218,7 +218,7 @@ sub discover_horizontal_shells {
Slic3r::debugf " looking for neighbors on layer %d...\n", $n; Slic3r::debugf " looking for neighbors on layer %d...\n", $n;
foreach my $surfaces (@{$self->layers->[$n]->fill_surfaces}) { foreach my $surfaces (@{$self->layers->[$n]->fill_surfaces}) {
my $neighbor_polygons = [ map $_->p, grep $_->surface_type eq 'internal', @$surfaces ]; my $neighbor_polygons = [ map $_->p, @$surfaces ];
# find intersection between @surfaces and current layer's surfaces # find intersection between @surfaces and current layer's surfaces
# intersections have contours and holes # intersections have contours and holes
@ -235,26 +235,14 @@ sub discover_horizontal_shells {
# assign resulting inner surfaces to layer # assign resulting inner surfaces to layer
@$surfaces = (); @$surfaces = ();
foreach my $p (@$internal_polygons) { push @$surfaces, Slic3r::Surface->cast_from_expolygon
push @$surfaces, Slic3r::Surface->new( ($_, surface_type => 'internal')
surface_type => 'internal', for @$internal_polygons;
contour => $p->contour->closed_polyline,
holes => [
map $_->closed_polyline, $p->holes,
],
);
}
# assign new internal-solid surfaces to layer # assign new internal-solid surfaces to layer
foreach my $p (@$intersections) { push @$surfaces, Slic3r::Surface->cast_from_expolygon
push @$surfaces, Slic3r::Surface->new( ($_, surface_type => 'internal-solid')
surface_type => 'internal-solid', for @$intersections;
contour => $p->contour->closed_polyline,
holes => [
map $_->closed_polyline, $p->holes,
],
);
}
} }
} }
} }