Skip to content

Commit

Permalink
Use thick raft layers as we do for support material layers. #2723
Browse files Browse the repository at this point in the history
  • Loading branch information
alranel committed Mar 9, 2015
1 parent 8654537 commit 13b63d0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
12 changes: 9 additions & 3 deletions lib/Slic3r/Print/Object.pm
Expand Up @@ -62,7 +62,9 @@ sub slice {
my $support_material_layer_height;
{
my @nozzle_diameters = (
map $self->print->config->get_at('nozzle_diameter', $_), @{$self->print->support_material_extruders}
map $self->print->config->get_at('nozzle_diameter', $_),
$self->config->support_material_extruder,
$self->config->support_material_interface_extruder,
);
$support_material_layer_height = 0.75 * min(@nozzle_diameters);
}
Expand All @@ -76,11 +78,15 @@ sub slice {
);
$nozzle_diameter = sum(@nozzle_diameters)/@nozzle_diameters;
}
my $distance = $self->_support_material->contact_distance($first_layer_height, $nozzle_diameter);
my $distance = $self->_support_material->contact_distance($self->config->layer_height, $nozzle_diameter);

# force first layer print_z according to the contact distance
# (the loop below will raise print_z by such height)
$first_object_layer_height = $nozzle_diameter;
if ($self->config->support_material_contact_distance == 0) {
$first_object_layer_height = $distance;
} else {
$first_object_layer_height = $nozzle_diameter;
}
$first_object_layer_distance = $distance;
}

Expand Down
12 changes: 8 additions & 4 deletions t/support.t
@@ -1,4 +1,4 @@
use Test::More tests => 26;
use Test::More tests => 27;
use strict;
use warnings;

Expand Down Expand Up @@ -223,9 +223,9 @@ use Slic3r::Test;
my $config = Slic3r::Config->new_from_defaults;
$config->set('skirts', 0);
$config->set('start_gcode', '');
$config->set('raft_layers', 3);
$config->set('raft_layers', 8);
$config->set('nozzle_diameter', [0.4, 1]);
$config->set('layer_height', 0.3);
$config->set('layer_height', 0.1);
$config->set('first_layer_height', 0.8);
$config->set('support_material_extruder', 2);
$config->set('support_material_interface_extruder', 2);
Expand All @@ -245,13 +245,17 @@ use Slic3r::Test;
push @z, $args->{Z};
} elsif ($info->{extruding} && $info->{dist_XY} > 0) {
$layer_heights_by_tool{$tool} ||= [];
push @{ $layer_heights_by_tool{$tool} }, $z[-1] - $z[-2] if $tool == 0;
push @{ $layer_heights_by_tool{$tool} }, $z[-1] - $z[-2];
}
});

ok !defined(first { $_ > $config->nozzle_diameter->[0] + epsilon }
@{ $layer_heights_by_tool{$config->perimeter_extruder-1} }),
'no object layer is thicker than nozzle diameter';

ok !defined(first { abs($_ - $config->layer_height) < epsilon }
@{ $layer_heights_by_tool{$config->support_material_extruder-1} }),
'no support material layer is as thin as object layers';
}

__END__

0 comments on commit 13b63d0

Please sign in to comment.