mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Fix extruder assignment and tests
This commit is contained in:
parent
10bf334a58
commit
071097d3f1
10 changed files with 109 additions and 186 deletions
|
@ -1,7 +1,7 @@
|
|||
package Slic3r::GCode;
|
||||
use Moo;
|
||||
|
||||
use List::Util qw(min first);
|
||||
use List::Util qw(min max first);
|
||||
use Slic3r::ExtrusionPath ':roles';
|
||||
use Slic3r::Flow ':roles';
|
||||
use Slic3r::Geometry qw(epsilon scale unscale scaled_epsilon points_coincide PI X Y B);
|
||||
|
@ -27,6 +27,7 @@ has 'speed' => (is => 'rw');
|
|||
has '_extrusion_axis' => (is => 'rw');
|
||||
has '_retract_lift' => (is => 'rw');
|
||||
has 'extruders' => (is => 'ro', default => sub {{}});
|
||||
has 'multiple_extruders' => (is => 'rw', default => sub {0});
|
||||
has 'extruder' => (is => 'rw');
|
||||
has 'speeds' => (is => 'lazy'); # mm/min
|
||||
has 'external_mp' => (is => 'rw');
|
||||
|
@ -55,6 +56,11 @@ sub set_extruders {
|
|||
$self->extruders->{$i} = my $e = Slic3r::Extruder->new_from_config($self->print_config, $i);
|
||||
$self->enable_wipe(1) if $e->wipe;
|
||||
}
|
||||
|
||||
# we enable support for multiple extruder if any extruder greater than 0 is used
|
||||
# (even if prints only uses that one) since we need to output Tx commands
|
||||
# first extruder has index 0
|
||||
$self->multiple_extruders(max(@$extruder_ids) > 0);
|
||||
}
|
||||
|
||||
sub _build_speeds {
|
||||
|
@ -81,11 +87,6 @@ my %role_speeds = (
|
|||
&EXTR_ROLE_GAPFILL => 'gap_fill',
|
||||
);
|
||||
|
||||
sub multiple_extruders {
|
||||
my $self = shift;
|
||||
return (keys %{$self->extruders}) > 1;
|
||||
}
|
||||
|
||||
sub set_shift {
|
||||
my ($self, @shift) = @_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue