From 8735ac3c571fb5b494a4bf061cdac55525b770a0 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 11 Jan 2012 23:15:32 +0100 Subject: [PATCH] Bridges now have higher priority than other solid surfaces. #140 --- lib/Slic3r/Fill.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Fill.pm b/lib/Slic3r/Fill.pm index a817c6ff5..eab0633dd 100644 --- a/lib/Slic3r/Fill.pm +++ b/lib/Slic3r/Fill.pm @@ -52,7 +52,12 @@ sub make_fill { my @surfaces = (); { my @surfaces_with_bridge_angle = grep defined $_->bridge_angle, @{$layer->fill_surfaces}; - foreach my $group (Slic3r::Surface->group({merge_solid => 1}, @{$layer->fill_surfaces})) { + + # give priority to bridges + my @groups = Slic3r::Surface->group({merge_solid => 1}, @{$layer->fill_surfaces}); + @groups = sort { defined $a->[0]->bridge_angle ? -1 : 0 } @groups; + + foreach my $group (@groups) { my $union = union_ex([ map $_->p, @$group ], undef, 1); # subtract surfaces having a defined bridge_angle from any other