1
package Slic3r::Extruder;
6
our @ISA = qw(Exporter);
7
our @EXPORT_OK = qw(EXTRUDER_ROLE_PERIMETER EXTRUDER_ROLE_INFILL EXTRUDER_ROLE_SUPPORT_MATERIAL
8
EXTRUDER_ROLE_SUPPORT_MATERIAL_INTERFACE);
9
our %EXPORT_TAGS = (roles => \@EXPORT_OK);
11
use Slic3r::Geometry qw(PI scale);
13
# has 'e_per_mm3' => (is => 'lazy');
14
# has 'retract_speed_mm_min' => (is => 'lazy');
16
use constant EXTRUDER_ROLE_PERIMETER => 1;
17
use constant EXTRUDER_ROLE_INFILL => 2;
18
use constant EXTRUDER_ROLE_SUPPORT_MATERIAL => 3;
19
use constant EXTRUDER_ROLE_SUPPORT_MATERIAL_INTERFACE => 4;
24
return $self->extrusion_multiplier * (4 / (($self->filament_diameter ** 2) * PI));
27
sub retract_speed_mm_min {
29
return $self->retract_speed * 60;
32
sub scaled_wipe_distance {
33
my ($self, $travel_speed) = @_;
35
# how far do we move in XY at travel_speed for the time needed to consume
36
# retract_length at retract_speed?
37
# reduce feedrate a bit; travel speed is often too high to move on existing material
38
# too fast = ripping of existing material; too slow = short wipe path, thus more blob
39
return scale($self->retract_length / $self->retract_speed * $travel_speed * 0.8);
44
return $E * ($self->filament_diameter**2) * PI/4;
48
my ($self, $mm3_per_mm) = @_;
49
return $mm3_per_mm * $self->e_per_mm3;