New --bridge-feed-rate option. #68
This commit is contained in:
parent
7b50e1bead
commit
975387d953
@ -94,19 +94,23 @@ The author is Alessandro Ranellucci (me).
|
|||||||
(+/-, default: 0)
|
(+/-, default: 0)
|
||||||
--gcode-arcs Use G2/G3 commands for native arcs (experimental, not supported
|
--gcode-arcs Use G2/G3 commands for native arcs (experimental, not supported
|
||||||
by all firmwares)
|
by all firmwares)
|
||||||
|
--g0 Use G0 commands for retraction (experimenta, not supported by all
|
||||||
|
firmwares)
|
||||||
|
|
||||||
Filament options:
|
Filament options:
|
||||||
--filament-diameter Diameter in mm of your raw filament (default: 3)
|
--filament-diameter Diameter in mm of your raw filament (default: 3)
|
||||||
--filament-packing-density
|
--extrusion-multiplier
|
||||||
Ratio of the extruded volume over volume pushed
|
Change this to alter the amount of plastic extruded. There should be
|
||||||
into the extruder (default: 1)
|
very little need to change this value, which is only useful to
|
||||||
--temperature Extrusion temperature (default: 200)
|
compensate for filament packing (default: 1)
|
||||||
|
--temperature Extrusion temperature, set 0 to disable (default: 200)
|
||||||
|
|
||||||
Speed options:
|
Speed options:
|
||||||
--print-feed-rate Speed of print moves in mm/sec (default: 60)
|
--print-feed-rate Speed of print moves in mm/sec (default: 60)
|
||||||
--travel-feed-rate Speed of non-print moves in mm/sec (default: 130)
|
--travel-feed-rate Speed of non-print moves in mm/sec (default: 130)
|
||||||
--perimeter-feed-rate
|
--perimeter-feed-rate
|
||||||
Speed of print moves for perimeters in mm/sec (default: 60)
|
Speed of print moves for perimeters in mm/sec (default: 60)
|
||||||
|
--bridge-feed-rate Speed of bridge print moves in mm/sec (default: 60)
|
||||||
--bottom-layer-speed-ratio
|
--bottom-layer-speed-ratio
|
||||||
Factor to increase/decrease speeds on bottom
|
Factor to increase/decrease speeds on bottom
|
||||||
layer by (default: 0.3)
|
layer by (default: 0.3)
|
||||||
@ -118,6 +122,9 @@ The author is Alessandro Ranellucci (me).
|
|||||||
layer with (> 0, default: 1)
|
layer with (> 0, default: 1)
|
||||||
--infill-every-layers
|
--infill-every-layers
|
||||||
Infill every N layers (default: 1)
|
Infill every N layers (default: 1)
|
||||||
|
--extrusion-width-ratio
|
||||||
|
Calculate the extrusion width as the layer height multiplied by
|
||||||
|
this value (> 0, default: calculated automatically)
|
||||||
|
|
||||||
Print options:
|
Print options:
|
||||||
--perimeters Number of perimeters/horizontal skins (range: 1+,
|
--perimeters Number of perimeters/horizontal skins (range: 1+,
|
||||||
|
@ -50,6 +50,7 @@ our $temperature = 200;
|
|||||||
our $print_feed_rate = 60; # mm/sec
|
our $print_feed_rate = 60; # mm/sec
|
||||||
our $travel_feed_rate = 130; # mm/sec
|
our $travel_feed_rate = 130; # mm/sec
|
||||||
our $perimeter_feed_rate = 30; # mm/sec
|
our $perimeter_feed_rate = 30; # mm/sec
|
||||||
|
our $bridge_feed_rate = 60; # mm/sec
|
||||||
our $bottom_layer_speed_ratio = 0.3;
|
our $bottom_layer_speed_ratio = 0.3;
|
||||||
|
|
||||||
# accuracy options
|
# accuracy options
|
||||||
|
@ -59,6 +59,10 @@ our $Options = {
|
|||||||
label => 'Perimeter feed rate (mm/s)',
|
label => 'Perimeter feed rate (mm/s)',
|
||||||
type => 'f',
|
type => 'f',
|
||||||
},
|
},
|
||||||
|
'bridge_feed_rate' => {
|
||||||
|
label => 'Bridge feed rate (mm/s)',
|
||||||
|
type => 'f',
|
||||||
|
},
|
||||||
'bottom_layer_speed_ratio' => {
|
'bottom_layer_speed_ratio' => {
|
||||||
label => 'Bottom layer ratio',
|
label => 'Bottom layer ratio',
|
||||||
type => 'f',
|
type => 'f',
|
||||||
@ -351,6 +355,9 @@ sub validate {
|
|||||||
# --skirt-height
|
# --skirt-height
|
||||||
die "Invalid value for --skirt-height\n"
|
die "Invalid value for --skirt-height\n"
|
||||||
if $Slic3r::skirt_height < 1;
|
if $Slic3r::skirt_height < 1;
|
||||||
|
|
||||||
|
# legacy with existing config files
|
||||||
|
$Slic3r::bridge_feed_rate ||= $Slic3r::print_feed_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -5,6 +5,9 @@ use XXX;
|
|||||||
|
|
||||||
extends 'Slic3r::Polyline::Closed';
|
extends 'Slic3r::Polyline::Closed';
|
||||||
|
|
||||||
|
# perimeter/fill/bridge/skirt
|
||||||
|
has 'role' => (is => 'ro', required => 1);
|
||||||
|
|
||||||
sub split_at {
|
sub split_at {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($point) = @_;
|
my ($point) = @_;
|
||||||
@ -25,7 +28,7 @@ sub split_at {
|
|||||||
push @new_points, @{$self->points}[$i .. $#{$self->points}];
|
push @new_points, @{$self->points}[$i .. $#{$self->points}];
|
||||||
push @new_points, @{$self->points}[0 .. $i];
|
push @new_points, @{$self->points}[0 .. $i];
|
||||||
|
|
||||||
return Slic3r::ExtrusionPath->new(points => [@new_points]);
|
return Slic3r::ExtrusionPath->new(points => [@new_points], role => $self->role);
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -7,6 +7,9 @@ extends 'Slic3r::Polyline';
|
|||||||
# expressed in layers
|
# expressed in layers
|
||||||
has 'depth_layers' => (is => 'ro', default => sub {1});
|
has 'depth_layers' => (is => 'ro', default => sub {1});
|
||||||
|
|
||||||
|
# perimeter/fill/bridge/skirt
|
||||||
|
has 'role' => (is => 'ro', required => 1);
|
||||||
|
|
||||||
use Slic3r::Geometry qw(PI X Y epsilon deg2rad rotate_points);
|
use Slic3r::Geometry qw(PI X Y epsilon deg2rad rotate_points);
|
||||||
use XXX;
|
use XXX;
|
||||||
|
|
||||||
@ -67,7 +70,12 @@ sub split_at_acute_angles {
|
|||||||
push @p, $p3;
|
push @p, $p3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
push @paths, (ref $self)->cast([@p]) if @p > 1;
|
push @paths, (ref $self)->cast(
|
||||||
|
[@p],
|
||||||
|
role => $self->role,
|
||||||
|
depth_layers => $self->depth_layers,
|
||||||
|
) if @p > 1;
|
||||||
|
|
||||||
return @paths;
|
return @paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,6 +160,7 @@ sub detect_arcs {
|
|||||||
|
|
||||||
my $arc = Slic3r::ExtrusionPath::Arc->new(
|
my $arc = Slic3r::ExtrusionPath::Arc->new(
|
||||||
points => [@arc_points],
|
points => [@arc_points],
|
||||||
|
role => $self->role,
|
||||||
orientation => $orientation,
|
orientation => $orientation,
|
||||||
center => $arc_center,
|
center => $arc_center,
|
||||||
radius => $arc_center->distance_to($points[$i]),
|
radius => $arc_center->distance_to($points[$i]),
|
||||||
|
@ -80,10 +80,10 @@ sub make_fill {
|
|||||||
my $filler = $Slic3r::fill_pattern;
|
my $filler = $Slic3r::fill_pattern;
|
||||||
my $density = $Slic3r::fill_density;
|
my $density = $Slic3r::fill_density;
|
||||||
my $flow_width = $Slic3r::flow_width;
|
my $flow_width = $Slic3r::flow_width;
|
||||||
|
my $is_bridge = $layer->id > 0 && $surface->surface_type eq 'bottom';
|
||||||
|
|
||||||
# force 100% density and rectilinear fill for external surfaces
|
# force 100% density and rectilinear fill for external surfaces
|
||||||
if ($surface->surface_type ne 'internal') {
|
if ($surface->surface_type ne 'internal') {
|
||||||
my $is_bridge = $layer->id > 0 && $surface->surface_type eq 'bottom';
|
|
||||||
$density = 1;
|
$density = 1;
|
||||||
$filler = $is_bridge ? 'rectilinear' : $Slic3r::solid_fill_pattern;
|
$filler = $is_bridge ? 'rectilinear' : $Slic3r::solid_fill_pattern;
|
||||||
$flow_width = $Slic3r::nozzle_diameter if $is_bridge;
|
$flow_width = $Slic3r::nozzle_diameter if $is_bridge;
|
||||||
@ -102,6 +102,7 @@ sub make_fill {
|
|||||||
paths => [
|
paths => [
|
||||||
map Slic3r::ExtrusionPath->cast(
|
map Slic3r::ExtrusionPath->cast(
|
||||||
[ @$_ ],
|
[ @$_ ],
|
||||||
|
role => ($is_bridge ? 'bridge' : 'fill'),
|
||||||
depth_layers => $surface->depth_layers,
|
depth_layers => $surface->depth_layers,
|
||||||
), @paths,
|
), @paths,
|
||||||
],
|
],
|
||||||
|
@ -35,7 +35,7 @@ sub fill_surface {
|
|||||||
# make paths
|
# make paths
|
||||||
my @paths = ();
|
my @paths = ();
|
||||||
my $cur_pos = Slic3r::Point->new(0,0);
|
my $cur_pos = Slic3r::Point->new(0,0);
|
||||||
foreach my $loop (map Slic3r::ExtrusionLoop->cast($_), @loops) {
|
foreach my $loop (map Slic3r::ExtrusionLoop->cast($_, role => 'fill'), @loops) {
|
||||||
# find the point of the loop that is closest to the current extruder position
|
# find the point of the loop that is closest to the current extruder position
|
||||||
$cur_pos = $loop->nearest_point_to($cur_pos);
|
$cur_pos = $loop->nearest_point_to($cur_pos);
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ sub new {
|
|||||||
},
|
},
|
||||||
speed => {
|
speed => {
|
||||||
title => 'Speed',
|
title => 'Speed',
|
||||||
options => [qw(print_feed_rate travel_feed_rate perimeter_feed_rate bottom_layer_speed_ratio)],
|
options => [qw(travel_feed_rate print_feed_rate perimeter_feed_rate bridge_feed_rate bottom_layer_speed_ratio)],
|
||||||
},
|
},
|
||||||
accuracy => {
|
accuracy => {
|
||||||
title => 'Accuracy',
|
title => 'Accuracy',
|
||||||
|
@ -64,12 +64,12 @@ sub make_perimeter {
|
|||||||
foreach my $island (@perimeters) {
|
foreach my $island (@perimeters) {
|
||||||
# do holes starting from innermost one
|
# do holes starting from innermost one
|
||||||
foreach my $hole (map $_->holes, map @$_, @$island) {
|
foreach my $hole (map $_->holes, map @$_, @$island) {
|
||||||
push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->cast($hole);
|
push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->cast($hole, role => 'perimeter');
|
||||||
}
|
}
|
||||||
|
|
||||||
# do contours starting from innermost one
|
# do contours starting from innermost one
|
||||||
foreach my $contour (map $_->contour, map @$_, reverse @$island) {
|
foreach my $contour (map $_->contour, map @$_, reverse @$island) {
|
||||||
push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->cast($contour);
|
push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->cast($contour, role => 'perimeter');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -273,7 +273,7 @@ sub extrude_skirt {
|
|||||||
for (my $i = $Slic3r::skirts - 1; $i >= 0; $i--) {
|
for (my $i = $Slic3r::skirts - 1; $i >= 0; $i--) {
|
||||||
my $distance = ($Slic3r::skirt_distance + ($Slic3r::flow_width * $i)) / $Slic3r::resolution;
|
my $distance = ($Slic3r::skirt_distance + ($Slic3r::flow_width * $i)) / $Slic3r::resolution;
|
||||||
my $outline = offset([$convex_hull], $distance, $Slic3r::resolution * 100, JT_ROUND);
|
my $outline = offset([$convex_hull], $distance, $Slic3r::resolution * 100, JT_ROUND);
|
||||||
push @skirts, Slic3r::ExtrusionLoop->cast([ @{$outline->[0]} ]);
|
push @skirts, Slic3r::ExtrusionLoop->cast([ @{$outline->[0]} ], role => 'skirt');
|
||||||
}
|
}
|
||||||
|
|
||||||
# apply skirts to all layers
|
# apply skirts to all layers
|
||||||
|
@ -42,6 +42,7 @@ GetOptions(
|
|||||||
'print-feed-rate=i' => \$Slic3r::print_feed_rate,
|
'print-feed-rate=i' => \$Slic3r::print_feed_rate,
|
||||||
'travel-feed-rate=i' => \$Slic3r::travel_feed_rate,
|
'travel-feed-rate=i' => \$Slic3r::travel_feed_rate,
|
||||||
'perimeter-feed-rate=i' => \$Slic3r::perimeter_feed_rate,
|
'perimeter-feed-rate=i' => \$Slic3r::perimeter_feed_rate,
|
||||||
|
'bridge-feed-rate=i' => \$Slic3r::bridge_feed_rate,
|
||||||
'bottom-layer-speed-ratio=f' => \$Slic3r::bottom_layer_speed_ratio,
|
'bottom-layer-speed-ratio=f' => \$Slic3r::bottom_layer_speed_ratio,
|
||||||
|
|
||||||
# accuracy options
|
# accuracy options
|
||||||
@ -147,9 +148,9 @@ Usage: slic3r.pl [ OPTIONS ] file.stl
|
|||||||
Filament options:
|
Filament options:
|
||||||
--filament-diameter Diameter in mm of your raw filament (default: $Slic3r::filament_diameter)
|
--filament-diameter Diameter in mm of your raw filament (default: $Slic3r::filament_diameter)
|
||||||
--extrusion-multiplier
|
--extrusion-multiplier
|
||||||
Change this to alter the amount of plastic extruded. There should be very little
|
Change this to alter the amount of plastic extruded. There should be
|
||||||
need to change this value, which is only useful to compensate for
|
very little need to change this value, which is only useful to
|
||||||
filament packing (default: $Slic3r::extrusion_multiplier)
|
compensate for filament packing (default: $Slic3r::extrusion_multiplier)
|
||||||
--temperature Extrusion temperature, set 0 to disable (default: $Slic3r::temperature)
|
--temperature Extrusion temperature, set 0 to disable (default: $Slic3r::temperature)
|
||||||
|
|
||||||
Speed options:
|
Speed options:
|
||||||
@ -157,6 +158,7 @@ Usage: slic3r.pl [ OPTIONS ] file.stl
|
|||||||
--travel-feed-rate Speed of non-print moves in mm/sec (default: $Slic3r::travel_feed_rate)
|
--travel-feed-rate Speed of non-print moves in mm/sec (default: $Slic3r::travel_feed_rate)
|
||||||
--perimeter-feed-rate
|
--perimeter-feed-rate
|
||||||
Speed of print moves for perimeters in mm/sec (default: $Slic3r::print_feed_rate)
|
Speed of print moves for perimeters in mm/sec (default: $Slic3r::print_feed_rate)
|
||||||
|
--bridge-feed-rate Speed of bridge print moves in mm/sec (default: $Slic3r::bridge_feed_rate)
|
||||||
--bottom-layer-speed-ratio
|
--bottom-layer-speed-ratio
|
||||||
Factor to increase/decrease speeds on bottom
|
Factor to increase/decrease speeds on bottom
|
||||||
layer by (default: $Slic3r::bottom_layer_speed_ratio)
|
layer by (default: $Slic3r::bottom_layer_speed_ratio)
|
||||||
|
4
t/arcs.t
4
t/arcs.t
@ -18,7 +18,7 @@ use Slic3r;
|
|||||||
[306517.1,219034.23], [286979.42,248012.49], [258001.16,267550.17], [222515.14,274714.47],
|
[306517.1,219034.23], [286979.42,248012.49], [258001.16,267550.17], [222515.14,274714.47],
|
||||||
[187029.11,267550.17], [158050.85,248012.49], [138513.17,219034.23], [131348.87,183548.2],
|
[187029.11,267550.17], [158050.85,248012.49], [138513.17,219034.23], [131348.87,183548.2],
|
||||||
[86948.77,175149.09], [119825.35,100585],
|
[86948.77,175149.09], [119825.35,100585],
|
||||||
]);
|
], role => 'fill');
|
||||||
|
|
||||||
my $collection = Slic3r::ExtrusionPath::Collection->new(paths => [$path]);
|
my $collection = Slic3r::ExtrusionPath::Collection->new(paths => [$path]);
|
||||||
$collection->detect_arcs(30);
|
$collection->detect_arcs(30);
|
||||||
@ -36,7 +36,7 @@ use Slic3r;
|
|||||||
[13.8268343236509,19.2387953251129], [14.5399049973955,18.9100652418837],
|
[13.8268343236509,19.2387953251129], [14.5399049973955,18.9100652418837],
|
||||||
[15.2249856471595,18.5264016435409], [15.8778525229247,18.0901699437495],
|
[15.2249856471595,18.5264016435409], [15.8778525229247,18.0901699437495],
|
||||||
[16.4944804833018,17.6040596560003],
|
[16.4944804833018,17.6040596560003],
|
||||||
]);
|
], role => 'fill');
|
||||||
my $collection = Slic3r::ExtrusionPath::Collection->new(paths => [$path]);
|
my $collection = Slic3r::ExtrusionPath::Collection->new(paths => [$path]);
|
||||||
$collection->detect_arcs(10, 1);
|
$collection->detect_arcs(10, 1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user