Add ability to have cross-hatched rectilinear support material. #509

medial-thinwall
Alessandro Ranellucci 2013-02-02 00:14:45 +01:00
parent 547dfb857d
commit d3727a1699
2 changed files with 11 additions and 5 deletions

View File

@ -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' => {

View File

@ -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(