Different speed for external perimeters. #488

This commit is contained in:
Alessandro Ranellucci 2012-06-27 19:37:34 +02:00
parent cc330932d6
commit 96a3234eaa
8 changed files with 33 additions and 11 deletions

View File

@ -130,6 +130,9 @@ The author is Alessandro Ranellucci.
--small-perimeter-speed
Speed of print moves for small perimeters in mm/s or % over perimeter speed
(default: 30)
--external-perimeter-speed
Speed of print moves for the external perimeter in mm/s or % over perimeter speed
(default: 100%)
--infill-speed Speed of print moves in mm/s (default: 60)
--solid-infill-speed Speed of print moves for solid surfaces in mm/s or % over infill speed
(default: 60)

View File

@ -81,6 +81,7 @@ our $first_layer_bed_temperature;
our $travel_speed = 130; # mm/s
our $perimeter_speed = 30; # mm/s
our $small_perimeter_speed = 30; # mm/s or %
our $external_perimeter_speed = '100%'; # mm/s or %
our $infill_speed = 60; # mm/s
our $solid_infill_speed = 60; # mm/s or %
our $top_solid_infill_speed = 50; # mm/s or %

View File

@ -140,6 +140,12 @@ our $Options = {
type => 'f',
ratio_over => 'perimeter_speed',
},
'external_perimeter_speed' => {
label => 'External perimeters (mm/s or %)',
cli => 'external-perimeter-speed=s',
type => 'f',
ratio_over => 'perimeter_speed',
},
'infill_speed' => {
label => 'Infill (mm/s)',
cli => 'infill-speed=f',

View File

@ -27,6 +27,7 @@ has 'speeds' => (
travel => 60 * Slic3r::Config->get('travel_speed'),
perimeter => 60 * Slic3r::Config->get('perimeter_speed'),
small_perimeter => 60 * Slic3r::Config->get('small_perimeter_speed'),
external_perimeter => 60 * Slic3r::Config->get('external_perimeter_speed'),
infill => 60 * Slic3r::Config->get('infill_speed'),
solid_infill => 60 * Slic3r::Config->get('solid_infill_speed'),
top_solid_infill => 60 * Slic3r::Config->get('top_solid_infill_speed'),
@ -38,6 +39,7 @@ has 'speeds' => (
my %role_speeds = (
&EXTR_ROLE_PERIMETER => 'perimeter',
&EXTR_ROLE_SMALLPERIMETER => 'small_perimeter',
&EXTR_ROLE_EXTERNAL_PERIMETER => 'external_perimeter',
&EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER => 'perimeter',
&EXTR_ROLE_FILL => 'infill',
&EXTR_ROLE_SOLIDFILL => 'solid_infill',

View File

@ -3,7 +3,8 @@ use Moo;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(EXTR_ROLE_PERIMETER EXTR_ROLE_SMALLPERIMETER EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER
our @EXPORT_OK = qw(EXTR_ROLE_PERIMETER EXTR_ROLE_SMALLPERIMETER EXTR_ROLE_EXTERNAL_PERIMETER
EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER
EXTR_ROLE_FILL EXTR_ROLE_SOLIDFILL EXTR_ROLE_TOPSOLIDFILL EXTR_ROLE_BRIDGE EXTR_ROLE_SKIRT
EXTR_ROLE_SUPPORTMATERIAL);
our %EXPORT_TAGS = (roles => \@EXPORT_OK);
@ -26,13 +27,14 @@ has 'flow_spacing' => (is => 'rw');
has 'role' => (is => 'rw', required => 1);
use constant EXTR_ROLE_PERIMETER => 0;
use constant EXTR_ROLE_SMALLPERIMETER => 1;
use constant EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER => 2;
use constant EXTR_ROLE_FILL => 3;
use constant EXTR_ROLE_SOLIDFILL => 4;
use constant EXTR_ROLE_TOPSOLIDFILL => 5;
use constant EXTR_ROLE_BRIDGE => 6;
use constant EXTR_ROLE_SKIRT => 7;
use constant EXTR_ROLE_SUPPORTMATERIAL => 8;
use constant EXTR_ROLE_EXTERNAL_PERIMETER => 2;
use constant EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER => 3;
use constant EXTR_ROLE_FILL => 4;
use constant EXTR_ROLE_SOLIDFILL => 5;
use constant EXTR_ROLE_TOPSOLIDFILL => 6;
use constant EXTR_ROLE_BRIDGE => 7;
use constant EXTR_ROLE_SKIRT => 8;
use constant EXTR_ROLE_SUPPORTMATERIAL => 9;
sub BUILD {
my $self = shift;

View File

@ -32,7 +32,7 @@ sub new {
},
print_speed => {
title => 'Print speed',
options => [qw(perimeter_speed small_perimeter_speed infill_speed solid_infill_speed top_solid_infill_speed bridge_speed)],
options => [qw(perimeter_speed small_perimeter_speed external_perimeter_speed infill_speed solid_infill_speed top_solid_infill_speed bridge_speed)],
},
speed => {
title => 'Other speed settings',

View File

@ -291,6 +291,7 @@ sub make_perimeters {
foreach my $island (@perimeters) {
# do holes starting from innermost one
my @holes = ();
my %is_external = ();
my @hole_depths = map [ map $_->holes, @$_ ], @$island;
# organize the outermost hole loops using a shortest path search
@ -303,6 +304,7 @@ sub make_perimeters {
# take first available hole
push @holes, shift @{$hole_depths[0]};
$is_external{$#holes} = 1;
my $current_depth = 0;
while (1) {
@ -333,9 +335,12 @@ sub make_perimeters {
}
# do holes, then contours starting from innermost one
$self->add_perimeter($_) for reverse @holes;
$self->add_perimeter($holes[$_], $is_external{$_} ? EXTR_ROLE_EXTERNAL_PERIMETER : undef)
for reverse 0 .. $#holes;
for my $depth (reverse 0 .. $#$island) {
my $role = $depth == $#$island ? EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER : EXTR_ROLE_PERIMETER;
my $role = $depth == $#$island ? EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER
: $depth == 0 ? EXTR_ROLE_EXTERNAL_PERIMETER
: EXTR_ROLE_PERIMETER;
$self->add_perimeter($_, $role) for map $_->contour, @{$island->[$depth]};
}
}

View File

@ -175,6 +175,9 @@ $j
--small-perimeter-speed
Speed of print moves for small perimeters in mm/s or % over perimeter speed
(default: $Slic3r::small_perimeter_speed)
--external-perimeter-speed
Speed of print moves for the external perimeter in mm/s or % over perimeter speed
(default: $Slic3r::external_perimeter_speed)
--infill-speed Speed of print moves in mm/s (default: $Slic3r::infill_speed)
--solid-infill-speed Speed of print moves for solid surfaces in mm/s or % over infill speed
(default: $Slic3r::solid_infill_speed)