2011-09-26 09:42:08 +00:00
|
|
|
package Slic3r::Extruder;
|
|
|
|
use Moo;
|
|
|
|
|
2012-06-28 12:44:54 +00:00
|
|
|
use Slic3r::Geometry qw(PI);
|
2011-12-07 18:33:59 +00:00
|
|
|
|
2012-06-28 12:44:54 +00:00
|
|
|
has 'nozzle_diameter' => (is => 'rw', required => 1);
|
|
|
|
has 'filament_diameter' => (is => 'rw', required => 1);
|
|
|
|
has 'extrusion_multiplier' => (is => 'rw', required => 1);
|
2011-09-26 09:42:08 +00:00
|
|
|
|
2012-06-28 12:44:54 +00:00
|
|
|
has 'e_per_mmc' => (is => 'rw');
|
2011-09-26 09:42:08 +00:00
|
|
|
|
2012-06-28 12:44:54 +00:00
|
|
|
sub BUILD {
|
2012-05-20 18:07:39 +00:00
|
|
|
my $self = shift;
|
2012-06-28 12:44:54 +00:00
|
|
|
$self->e_per_mmc(
|
|
|
|
$Slic3r::scaling_factor
|
|
|
|
* $self->extrusion_multiplier
|
|
|
|
* (4 / (($self->filament_diameter ** 2) * PI))
|
|
|
|
);
|
2012-05-20 18:07:39 +00:00
|
|
|
}
|
|
|
|
|
2012-06-28 12:44:54 +00:00
|
|
|
sub make_flow {
|
2012-05-20 18:07:39 +00:00
|
|
|
my $self = shift;
|
2012-06-28 12:44:54 +00:00
|
|
|
return Slic3r::Flow->new(nozzle_diameter => $self->nozzle_diameter, @_);
|
2012-05-20 18:07:39 +00:00
|
|
|
}
|
|
|
|
|
2011-09-26 09:42:08 +00:00
|
|
|
1;
|