Refactor extruder settings
This commit is contained in:
parent
106c8fe46f
commit
63e77fcfd8
2 changed files with 5 additions and 6 deletions
|
@ -3,11 +3,10 @@ use Moo;
|
||||||
|
|
||||||
use Slic3r::Geometry qw(PI);
|
use Slic3r::Geometry qw(PI);
|
||||||
|
|
||||||
has 'nozzle_diameter' => (is => 'ro', required => 1);
|
use constant OPTIONS => [qw(
|
||||||
has 'filament_diameter' => (is => 'ro', required => 1);
|
nozzle_diameter filament_diameter extrusion_multiplier temperature first_layer_temperature
|
||||||
has 'extrusion_multiplier' => (is => 'ro', required => 1);
|
)];
|
||||||
has 'temperature' => (is => 'ro', required => 1);
|
has $_ => (is => 'ro', required => 1) for @{&OPTIONS};
|
||||||
has 'first_layer_temperature' => (is => 'rw', required => 1);
|
|
||||||
|
|
||||||
has 'e_per_mm3' => (is => 'lazy');
|
has 'e_per_mm3' => (is => 'lazy');
|
||||||
has '_mm3_per_mm_cache' => (is => 'ro', default => sub {{}});
|
has '_mm3_per_mm_cache' => (is => 'ro', default => sub {{}});
|
||||||
|
|
|
@ -46,7 +46,7 @@ sub _trigger_config {
|
||||||
for my $t (0, map $_-1, map $self->config->get($_), qw(perimeter_extruder infill_extruder support_material_extruder)) {
|
for my $t (0, map $_-1, map $self->config->get($_), qw(perimeter_extruder infill_extruder support_material_extruder)) {
|
||||||
$Slic3r::extruders->[$t] ||= Slic3r::Extruder->new(
|
$Slic3r::extruders->[$t] ||= Slic3r::Extruder->new(
|
||||||
map { $_ => $self->config->get($_)->[$t] // $self->config->get($_)->[0] } #/
|
map { $_ => $self->config->get($_)->[$t] // $self->config->get($_)->[0] } #/
|
||||||
qw(nozzle_diameter filament_diameter extrusion_multiplier temperature first_layer_temperature)
|
@{&Slic3r::Extruder::OPTIONS}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue