New experimental feature for pressure management. Credits to @llluis for the original implementation. #1203 #1677 #2018

This commit is contained in:
Alessandro Ranellucci 2014-11-24 18:22:39 +01:00
parent 5a382f0200
commit ff9b53260d
9 changed files with 108 additions and 2 deletions

View file

@ -11,6 +11,7 @@ has 'origin' => (is => 'ro', default => sub { Slic3r::Poi
has 'spiralvase' => (is => 'lazy');
has 'vibration_limit' => (is => 'lazy');
has 'arc_fitting' => (is => 'lazy');
has 'pressure_regulator' => (is => 'lazy');
has 'skirt_done' => (is => 'rw', default => sub { {} }); # print_z => 1
has 'brim_done' => (is => 'rw');
has 'second_layer_things_done' => (is => 'rw');
@ -40,6 +41,14 @@ sub _build_arc_fitting {
: undef;
}
sub _build_pressure_regulator {
my $self = shift;
return $self->print->config->pressure_advance > 0
? Slic3r::GCode::PressureRegulator->new(config => $self->print->config)
: undef;
}
sub process_layer {
my $self = shift;
my ($layer, $object_copies) = @_;
@ -197,6 +206,10 @@ sub process_layer {
$gcode = $self->vibration_limit->process($gcode)
if $self->print->config->vibration_limit != 0;
# apply pressure regulation if enabled
$gcode = $self->pressure_regulator->process($gcode)
if $self->print->config->pressure_advance > 0;
# apply arc fitting if enabled
$gcode = $self->arc_fitting->process($gcode)
if $self->print->config->gcode_arcs;