From d3727a16998ea0ac1fff63669fa92ac5fa13acf7 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 2 Feb 2013 00:14:45 +0100 Subject: [PATCH] Add ability to have cross-hatched rectilinear support material. #509 --- lib/Slic3r/Config.pm | 4 ++-- lib/Slic3r/Print/Object.pm | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index f57eff597..7031dbd90 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -558,8 +558,8 @@ our $Options = { tooltip => 'Pattern used to generate support material.', cli => 'support-material-pattern=s', type => 'select', - values => [qw(rectilinear honeycomb)], - labels => [qw(rectilinear honeycomb)], + values => [qw(rectilinear rectilinear-grid honeycomb)], + labels => ['rectilinear', 'rectilinear grid', 'honeycomb'], default => 'rectilinear', }, 'support_material_spacing' => { diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index 248981c67..f628da2ad 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -643,9 +643,15 @@ sub generate_support_material { my @support_material_areas = map $_->offset_ex(- 0.5 * $flow->scaled_width), @{union_ex([ map $_->contour, map @$_, values %layers ])}; - my $filler = Slic3r::Fill->filler($Slic3r::Config->support_material_pattern); - $filler->angle($Slic3r::Config->support_material_angle); - { + my $pattern = $Slic3r::Config->support_material_pattern; + my @angles = ($Slic3r::Config->support_material_angle); + if ($pattern eq 'rectilinear-grid') { + $pattern = 'rectilinear'; + push @angles, $angles[0] + 90; + } + my $filler = Slic3r::Fill->filler($pattern); + foreach my $angle (@angles) { + $filler->angle($angle); my @patterns = (); foreach my $expolygon (@support_material_areas) { my @paths = $filler->fill_surface(