Alter extrusion width automatic calculation to take "native flow" into account

This commit is contained in:
Alessandro Ranellucci 2013-01-02 19:22:51 +01:00
parent 30d9b2e508
commit cbd298bc36

View File

@ -1,6 +1,7 @@
package Slic3r::Flow; package Slic3r::Flow;
use Moo; use Moo;
use List::Util qw(max);
use Slic3r::Geometry qw(PI scale); use Slic3r::Geometry qw(PI scale);
has 'nozzle_diameter' => (is => 'ro', required => 1); has 'nozzle_diameter' => (is => 'ro', required => 1);
@ -37,8 +38,11 @@ sub _build_width {
$width = $self->nozzle_diameter * ($self->nozzle_diameter/$self->layer_height - 4/PI + 1); $width = $self->nozzle_diameter * ($self->nozzle_diameter/$self->layer_height - 4/PI + 1);
} }
my $min = $self->nozzle_diameter * 1.05; my $min = max(
my $max = $self->nozzle_diameter * 1.4; ((($self->nozzle_diameter/2) ** 2) / $self->layer_height * 0.8),
($self->nozzle_diameter * 1.05),
);
my $max = $self->nozzle_diameter * 1.6;
$width = $max if $width > $max; $width = $max if $width > $max;
$width = $min if $width < $min; $width = $min if $width < $min;