New option to force a solid layer every given number of layers. #617

This commit is contained in:
Alessandro Ranellucci 2012-09-28 15:46:29 +02:00
parent f50b0040ef
commit ab7697ec1c
5 changed files with 21 additions and 2 deletions

View File

@ -153,6 +153,8 @@ The author of the Silk icon set is Mark James.
--first-layer-height Layer height for first layer (mm or %, default: 100%) --first-layer-height Layer height for first layer (mm or %, default: 100%)
--infill-every-layers --infill-every-layers
Infill every N layers (default: 1) Infill every N layers (default: 1)
--solid-infill-every-layers
Force a solid layer every N layers (default: 0)
Print options: Print options:
--perimeters Number of perimeters/horizontal skins (range: 0+, default: 3) --perimeters Number of perimeters/horizontal skins (range: 0+, default: 3)

View File

@ -353,6 +353,15 @@ our $Options = {
min => 1, min => 1,
default => 1, default => 1,
}, },
'solid_infill_every_layers' => {
label => 'Solid infill every',
tooltip => 'This feature allows to force a solid layer every given number of layers. Zero to disable.',
sidetext => 'layers',
cli => 'solid-infill-every-layers=i',
type => 'i',
min => 0,
default => 0,
},
# flow options # flow options
'extrusion_width' => { 'extrusion_width' => {

View File

@ -401,7 +401,7 @@ sub build {
}, },
{ {
title => 'Advanced', title => 'Advanced',
options => [qw(infill_every_layers fill_angle solid_infill_below_area only_retract_when_crossing_perimeters)], options => [qw(infill_every_layers solid_infill_every_layers fill_angle solid_infill_below_area only_retract_when_crossing_perimeters)],
}, },
]); ]);

View File

@ -329,6 +329,12 @@ sub discover_horizontal_shells {
for my $region_id (0 .. ($self->print->regions_count-1)) { for my $region_id (0 .. ($self->print->regions_count-1)) {
for (my $i = 0; $i < $self->layer_count; $i++) { for (my $i = 0; $i < $self->layer_count; $i++) {
my $layerm = $self->layers->[$i]->regions->[$region_id]; my $layerm = $self->layers->[$i]->regions->[$region_id];
if ($Slic3r::Config->solid_infill_every_layers && ($i % $Slic3r::Config->solid_infill_every_layers) == 0) {
$_->surface_type(S_TYPE_INTERNALSOLID)
for grep $_->surface_type == S_TYPE_INTERNAL, @{$layerm->fill_surfaces};
}
foreach my $type (S_TYPE_TOP, S_TYPE_BOTTOM) { foreach my $type (S_TYPE_TOP, S_TYPE_BOTTOM) {
# find surfaces of current type for current layer # find surfaces of current type for current layer
# and offset them to take perimeters into account # and offset them to take perimeters into account

View File

@ -201,6 +201,8 @@ $j
--first-layer-height Layer height for first layer (mm or %, default: $config->{first_layer_height}) --first-layer-height Layer height for first layer (mm or %, default: $config->{first_layer_height})
--infill-every-layers --infill-every-layers
Infill every N layers (default: $config->{infill_every_layers}) Infill every N layers (default: $config->{infill_every_layers})
--solid-infill-every-layers
Force a solid layer every N layers (default: $config->{solid_infill_every_layers})
Print options: Print options:
--perimeters Number of perimeters/horizontal skins (range: 0+, default: $config->{perimeters}) --perimeters Number of perimeters/horizontal skins (range: 0+, default: $config->{perimeters})