diff options
author | bubnikv <bubnikv@gmail.com> | 2016-10-21 17:53:42 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2016-10-21 17:53:42 +0300 |
commit | 1fb57e439ef61bf99f9f23c06bfc774935180f33 (patch) | |
tree | 22650f82ce29d63484c1e179c96be9e0752db7ef /t | |
parent | 15d3e94a66f7be869a77171841fcfe1726f44c56 (diff) |
Defined the +-* operators on Pointf.
Removed the deprecated VibrationLimit feature.
Added triangle infill.
The Prusa3D fork of Slic3r has been marked as "Slic3r Prusa Edition"
with menus pointing to the prusa3d/slic3r github release page
and Prusa3D drivers downloads page.
Diffstat (limited to 't')
-rw-r--r-- | t/cooling.t | 1 | ||||
-rw-r--r-- | t/vibrationlimit.t | 98 |
2 files changed, 0 insertions, 99 deletions
diff --git a/t/cooling.t b/t/cooling.t index 9958037f1..f39fa0f52 100644 --- a/t/cooling.t +++ b/t/cooling.t @@ -109,7 +109,6 @@ $config->set('disable_fan_first_layers', 0); $config->set('bridge_speed', 99); $config->set('top_solid_layers', 1); # internal bridges use solid_infil speed $config->set('bottom_solid_layers', 1); # internal bridges use solid_infil speed - $config->set('vibration_limit', 30); # test that fan is turned on even when vibration limit (or other G-code post-processor) is enabled my $print = Slic3r::Test::init_print('overhang', config => $config); my $fan = 0; diff --git a/t/vibrationlimit.t b/t/vibrationlimit.t deleted file mode 100644 index 7bfa27acb..000000000 --- a/t/vibrationlimit.t +++ /dev/null @@ -1,98 +0,0 @@ -use Test::More tests => 9; -use strict; -use warnings; - -BEGIN { - use FindBin; - use lib "$FindBin::Bin/../lib"; -} - -use Slic3r; -use Slic3r::Geometry qw(epsilon); -use Slic3r::Test; - -my $config = Slic3r::Config->new_from_defaults; - -# tolerance, in minutes -# (our time estimation differs from the internal one because of decimals truncation) -my $epsilon = 0.002; - -my $test = sub { - my ($conf) = @_; - $conf ||= $config; - - my $print = Slic3r::Test::init_print('2x20x10', config => $conf); - - my $min_time = 1 / ($conf->vibration_limit * 60); # minimum time between direction changes in minutes - my %dir = (X => 0, Y => 0); - my %dir_time = (X => 0, Y => 0); - my %dir_sleep_time = (X => 0, Y => 0); - my $last_cmd_pause = 0; - Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub { - my ($self, $cmd, $args, $info) = @_; - - if ($cmd !~ /^G[01]$/) { - if ($cmd eq 'G4') { - $last_cmd_pause = (($args->{P} // 0) / 1000 + ($args->{S} // 0)) / 60; # in minutes - $dir_sleep_time{$_} += $last_cmd_pause for qw(X Y); - $last_cmd_pause -= $epsilon; # error builds up - } - return; - } - - # Z moves are slow enough that we can consider any vibration interrupted - if ($info->{dist_Z}) { - $dir_time{$_} += 99999 for qw(X Y); - $last_cmd_pause = 0; - return; - } elsif ($info->{dist_E} != 0 && $info->{dist_XY} == 0) { - my $time = abs($info->{dist_E}) / ($args->{F} // $self->F); # in minutes - $dir_time{$_} += $time for qw(X Y); - $last_cmd_pause = 0; - return; - } - - # compute move time (this assumes that the speed is XY-bound, which happens very likely) - my $time = abs($info->{dist_XY}) / ($args->{F} // $self->F); # in minutes - - my $one_axis_would_trigger_limit_without_pause = 0; - foreach my $axis (qw(X Y)) { - # get the direction by comparing the new $axis coordinate with the current one - # 1 = positive, 0 = no change, -1 = negative - my $dir = $info->{"new_$axis"} <=> $self->$axis; - - # are we changing direction on this axis? - if ($dir != 0 && $dir{$axis} != $dir) { - # this move changes direction on this axis - if ($dir{$axis} != 0) { - if (($dir_time{$axis} + $dir_sleep_time{$axis}) < ($min_time - $epsilon)) { - fail 'vibration limit exceeded'; - } - $one_axis_would_trigger_limit_without_pause = 1 - if ($dir_time{$axis} - $last_cmd_pause) < $min_time; - } - $dir{$axis} = $dir; - $dir_time{$axis} = 0; - $dir_sleep_time{$axis} = 0; - } - $dir_time{$axis} += $time; - } - fail 'no unnecessary pauses are added' - if $last_cmd_pause > $epsilon && !$one_axis_would_trigger_limit_without_pause; - - $last_cmd_pause = 0; - }); - - 1; -}; - -$config->set('gcode_comments', 1); -$config->set('perimeters', 1); -foreach my $frequency (5, 10, 15) { - foreach my $gapfillspeed (20, 50, 100) { - $config->set('vibration_limit', $frequency); - ok $test->(), "vibrations limited to ${frequency}Hz (gap fill speed = ${gapfillspeed} mm/s)"; - } -} - -__END__ |