Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2017-06-22 13:59:23 +0300
committerbubnikv <bubnikv@gmail.com>2017-06-22 13:59:23 +0300
commit0454cc95f949f1d7818566c466b313f56c352ca4 (patch)
treeec8c4694908a0ab0a2e7b06cb19c25c0505f9418 /t
parentc1146e298b8ff96bd029bad494627c5a6b547f56 (diff)
Ported the cooling changes from @alexrj: Don't slow down the external
perimeters if not necessary, don't take the bridging time into account when slowing down the print. Removed Extruder & GCodeWriter Perl bindings. Improved Extruder for constness. Refactored GCode::m_elapsed_time to struct ElapsedTime.
Diffstat (limited to 't')
-rw-r--r--t/cooling.t18
1 files changed, 15 insertions, 3 deletions
diff --git a/t/cooling.t b/t/cooling.t
index 560af1beb..29996c789 100644
--- a/t/cooling.t
+++ b/t/cooling.t
@@ -2,14 +2,14 @@ use Test::More;
use strict;
use warnings;
-plan tests => 12;
+plan tests => 13;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
}
-use List::Util qw(first);
+use List::Util qw(none all);
use Slic3r;
use Slic3r::Test;
@@ -139,21 +139,33 @@ $config->set('disable_fan_first_layers', [ 0 ]);
$config->set('slowdown_below_layer_time', [ 10 ]);
$config->set('min_print_speed', [ 0 ]);
$config->set('start_gcode', '');
+ $config->set('first_layer_speed', '100%');
+ $config->set('external_perimeter_speed', 99);
my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
my @layer_times = (0); # in seconds
+ my %layer_external = (); # z => 1
Slic3r::GCode::Reader->new->parse(my $gcode = Slic3r::Test::gcode($print), sub {
my ($self, $cmd, $args, $info) = @_;
if ($cmd eq 'G1') {
if ($info->{dist_Z}) {
push @layer_times, 0;
+ $layer_external{ $args->{Z} } = 0;
}
$layer_times[-1] += abs($info->{dist_XY} || $info->{dist_E} || $info->{dist_Z} || 0) / ($args->{F} // $self->F) * 60;
+ if ($args->{F} && $args->{F} == $config->external_perimeter_speed*60) {
+ $layer_external{ $self->Z }++;
+ }
}
});
- my $all_below = !defined first { $_ > 0 && $_ < $config->slowdown_below_layer_time->[0] } @layer_times;
+ @layer_times = grep $_, @layer_times;
+ my $all_below = none { $_ < $config->slowdown_below_layer_time->[0] } @layer_times;
ok $all_below, 'slowdown_below_layer_time is honored';
+
+ # check that all layers have at least one unaltered external perimeter speed
+ my $external = all { $_ > 0 } values %layer_external;
+ ok $external, 'slowdown_below_layer_time does not alter external perimeters';
}
__END__