diff --git a/lib/Slic3r/GUI/SkeinPanel.pm b/lib/Slic3r/GUI/SkeinPanel.pm index b2d92bdfa..6189b8c55 100644 --- a/lib/Slic3r/GUI/SkeinPanel.pm +++ b/lib/Slic3r/GUI/SkeinPanel.pm @@ -158,7 +158,7 @@ sub do_slice { { local $SIG{__WARN__} = sub { my $message = shift; - Wx::MessageDialog->new($self, $message, 'Non-manifold object', + Wx::MessageDialog->new($self, $message, 'Warning', wxOK | wxICON_WARNING)->ShowModal; }; $skein->go; diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index 10e0a2ce4..04baf705c 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -266,14 +266,14 @@ sub process_bridges { my $bridge_over_hole = 0; my @edges = (); # edges are POLYLINES foreach my $supporting_surface (@supporting_surfaces) { - my @surface_edges = $supporting_surface->contour->clip_with_polygon($contour_offset); + my @surface_edges = map $_->clip_with_polygon($contour_offset), + ($supporting_surface->contour, @{$supporting_surface->holes}); + if (@supporting_surfaces == 1 && @surface_edges == 1 && @{$supporting_surface->contour->p} == @{$surface_edges[0]->p}) { $bridge_over_hole = 1; - } else { - @surface_edges = grep { @{$_->points} } @surface_edges; } - push @edges, @surface_edges; + push @edges, grep { @{$_->points} } @surface_edges; } Slic3r::debugf " Bridge is supported on %d edge(s)\n", scalar(@edges); Slic3r::debugf " and covers a hole\n" if $bridge_over_hole; diff --git a/lib/Slic3r/Perimeter.pm b/lib/Slic3r/Perimeter.pm index 99feac927..40402b070 100644 --- a/lib/Slic3r/Perimeter.pm +++ b/lib/Slic3r/Perimeter.pm @@ -34,15 +34,14 @@ sub make_perimeter { ])}; foreach my $surface (@surfaces) { - # the outer loop must be offsetted by half extrusion width inwards my @last_offsets = ($surface->expolygon); - my $distance = scale $Slic3r::flow_width / 2; + my $distance = 0; # create other offsets push @perimeters, []; for (my $loop = 0; $loop < $Slic3r::perimeters; $loop++) { # offsetting a polygon can result in one or many offset polygons - @last_offsets = map $_->offset_ex(-$distance), @last_offsets; + @last_offsets = map $_->offset_ex(-$distance), @last_offsets if $distance; push @{ $perimeters[-1] }, [@last_offsets]; # offset distance for inner loops diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 0c9bc4fc9..1b72b6302 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -181,6 +181,20 @@ sub detect_surfaces_type { @$expolygons; }; + # the contours must be offsetted by half extrusion width inwards + { + my $distance = scale $Slic3r::flow_width / 2; + foreach my $layer (@{$self->layers}) { + my @surfaces = @{$layer->slices}; + @{$layer->slices} = (); + foreach my $surface (@surfaces) { + push @{$layer->slices}, map Slic3r::Surface->cast_from_expolygon + ($_, surface_type => 'internal'), + $surface->expolygon->offset_ex(-$distance); + } + } + } + for (my $i = 0; $i < $self->layer_count; $i++) { my $layer = $self->layers->[$i]; Slic3r::debugf "Detecting solid surfaces for layer %d\n", $layer->id;