mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 02:37:51 -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
|
@ -9,6 +9,7 @@ has 'gcodegen' => (is => 'ro', required => 1);
|
|||
has 'shift' => (is => 'ro', required => 1);
|
||||
|
||||
has 'spiralvase' => (is => 'lazy');
|
||||
has 'vibration_limit' => (is => 'lazy');
|
||||
has 'skirt_done' => (is => 'rw', default => sub { {} }); # print_z => 1
|
||||
has 'brim_done' => (is => 'rw');
|
||||
has 'second_layer_things_done' => (is => 'rw');
|
||||
|
@ -22,6 +23,14 @@ sub _build_spiralvase {
|
|||
: undef;
|
||||
}
|
||||
|
||||
sub _build_vibration_limit {
|
||||
my $self = shift;
|
||||
|
||||
return $Slic3r::Config->vibration_limit
|
||||
? Slic3r::GCode::VibrationLimit->new(config => $self->gcodegen->config)
|
||||
: undef;
|
||||
}
|
||||
|
||||
sub process_layer {
|
||||
my $self = shift;
|
||||
my ($layer, $object_copies) = @_;
|
||||
|
@ -162,6 +171,10 @@ sub process_layer {
|
|||
$gcode = $self->spiralvase->process_layer($gcode, $layer)
|
||||
if $spiralvase;
|
||||
|
||||
# apply vibration limit if enabled
|
||||
$gcode = $self->vibration_limit->process($gcode)
|
||||
if $Slic3r::Config->vibration_limit != 0;
|
||||
|
||||
return $gcode;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue