From 0faebad4da19d7d358b6bc0186f2f362d2d47c71 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 14 Apr 2012 19:47:33 +0200 Subject: [PATCH] Make new support material algorithm effective --- lib/Slic3r/Print.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index a8959c697..2ba53f402 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -610,10 +610,18 @@ sub generate_support_material { } @b = @{union_ex([ map @$_, @c, @a ])}; - # get unsupported surfaces for current layer - @a = map $_->expolygon->offset_ex(scale $Slic3r::flow_spacing * $Slic3r::perimeters), - grep $_->surface_type eq 'bottom' && !defined $_->bridge_angle, - @{$layer->fill_surfaces}; + # get unsupported surfaces for current layer as all bottom slices + # minus the bridges offsetted to cover their perimeters. + # actually, we are marking as bridges more than we should be, so + # better build support material for bridges too rather than ignoring + # those parts. a visibility check algorithm is needed. + # @a = @{diff_ex( + # [ map $_->p, grep $_->surface_type eq 'bottom', @{$layer->slices} ], + # [ map @$_, map $_->expolygon->offset_ex(scale $Slic3r::flow_spacing * $Slic3r::perimeters), + # grep $_->surface_type eq 'bottom' && defined $_->bridge_angle, + # @{$layer->fill_surfaces} ], + # )}; + @a = map $_->expolygon, grep $_->surface_type eq 'bottom', @{$layer->slices}; $_->simplify(scale $Slic3r::flow_spacing * 3) for @a; push @unsupported_expolygons, @a;