mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-08 14:34:04 -06:00
Moved vibration limit to its own G-code filter
This commit is contained in:
parent
fb763b0187
commit
73c05a6092
18 changed files with 103 additions and 70 deletions
|
@ -20,7 +20,7 @@ use Slic3r::Test;
|
|||
my $print = Slic3r::Test::init_print('2x20x10', config => $conf);
|
||||
|
||||
my $last_move_was_z_change = 0;
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if ($last_move_was_z_change && $cmd ne $config->layer_gcode) {
|
||||
|
|
2
t/fill.t
2
t/fill.t
|
@ -174,7 +174,7 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ }
|
|||
|
||||
my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
|
||||
my %layers_with_extrusion = ();
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
$layers_with_extrusion{$self->Z} = 1 if $info->{extruding};
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ my $test = sub {
|
|||
|
||||
my @z = ();
|
||||
my @increments = ();
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if ($info->{dist_Z}) {
|
||||
|
|
|
@ -25,7 +25,7 @@ use Slic3r::Test;
|
|||
my $print = Slic3r::Test::init_print('overhang', config => $config);
|
||||
my $has_cw_loops = 0;
|
||||
my $cur_loop;
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if ($info->{extruding} && $info->{dist_XY} > 0) {
|
||||
|
@ -47,7 +47,7 @@ use Slic3r::Test;
|
|||
my $has_cw_loops = my $has_outwards_move = 0;
|
||||
my $cur_loop;
|
||||
my %external_loops = (); # print_z => count of external loops
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if ($info->{extruding} && $info->{dist_XY} > 0) {
|
||||
|
@ -77,7 +77,7 @@ use Slic3r::Test;
|
|||
my $print = Slic3r::Test::init_print('L', config => $config);
|
||||
my $loop_starts_from_convex_point = 0;
|
||||
my $cur_loop;
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if ($info->{extruding} && $info->{dist_XY} > 0) {
|
||||
|
@ -107,7 +107,7 @@ use Slic3r::Test;
|
|||
my $print = Slic3r::Test::init_print('overhang', config => $config);
|
||||
my %layer_speeds = (); # print Z => [ speeds ]
|
||||
my $fan_speed = 0;
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
$fan_speed = 0 if $cmd eq 'M107';
|
||||
|
|
|
@ -25,7 +25,7 @@ my $test = sub {
|
|||
my $lifted = 0;
|
||||
my $changed_tool = 0;
|
||||
my $wait_for_toolchange = 0;
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if ($cmd =~ /^T(\d+)/) {
|
||||
|
|
|
@ -27,7 +27,7 @@ use Slic3r::Test;
|
|||
my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
|
||||
|
||||
my %layers_with_shells = (); # Z => $count
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if ($self->Z > 0) {
|
||||
|
@ -74,7 +74,7 @@ use Slic3r::Test;
|
|||
|
||||
my $print = Slic3r::Test::init_print('V', config => $config);
|
||||
my %layers_with_solid_infill = (); # Z => 1
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
$layers_with_solid_infill{$self->Z} = 1
|
||||
|
@ -106,7 +106,7 @@ use Slic3r::Test;
|
|||
|
||||
my $print = Slic3r::Test::init_print('V', config => $config);
|
||||
my %layers = (); # Z => 1
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
$layers{$self->Z} = 1
|
||||
if $info->{extruding} && ($args->{F} // $self->F) == $config->solid_infill_speed*60;
|
||||
|
@ -132,7 +132,7 @@ use Slic3r::Test;
|
|||
my $travel_moves_after_first_extrusion = 0;
|
||||
my $started_extruding = 0;
|
||||
my @z_steps = ();
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
$started_extruding = 1 if $info->{extruding};
|
||||
|
|
|
@ -27,7 +27,7 @@ use Slic3r::Test;
|
|||
my $print = Slic3r::Test::init_print(['20mm_cube','20mm_cube'], config => $config);
|
||||
|
||||
my %layers_with_skirt = (); # Z => $count
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if (defined $self->Z) {
|
||||
|
|
|
@ -65,7 +65,7 @@ use Slic3r::Test;
|
|||
ok my $gcode = Slic3r::Test::gcode($print), 'no conflict between raft/support and brim';
|
||||
|
||||
my $tool = 0;
|
||||
Slic3r::GCode::Reader->new(gcode => $gcode)->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse($gcode, sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if ($cmd =~ /^T(\d+)/) {
|
||||
|
|
|
@ -28,7 +28,7 @@ my $test = sub {
|
|||
my %dir_time = (X => 0, Y => 0);
|
||||
my %dir_sleep_time = (X => 0, Y => 0);
|
||||
my $last_cmd_pause = 0;
|
||||
Slic3r::GCode::Reader->new(gcode => Slic3r::Test::gcode($print))->parse(sub {
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if ($cmd !~ /^G[01]$/) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue