mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-20 07:11:12 -06:00
New --bridge-feed-rate option. #68
This commit is contained in:
parent
7b50e1bead
commit
975387d953
12 changed files with 47 additions and 17 deletions
|
@ -50,6 +50,7 @@ our $temperature = 200;
|
|||
our $print_feed_rate = 60; # mm/sec
|
||||
our $travel_feed_rate = 130; # mm/sec
|
||||
our $perimeter_feed_rate = 30; # mm/sec
|
||||
our $bridge_feed_rate = 60; # mm/sec
|
||||
our $bottom_layer_speed_ratio = 0.3;
|
||||
|
||||
# accuracy options
|
||||
|
|
|
@ -59,6 +59,10 @@ our $Options = {
|
|||
label => 'Perimeter feed rate (mm/s)',
|
||||
type => 'f',
|
||||
},
|
||||
'bridge_feed_rate' => {
|
||||
label => 'Bridge feed rate (mm/s)',
|
||||
type => 'f',
|
||||
},
|
||||
'bottom_layer_speed_ratio' => {
|
||||
label => 'Bottom layer ratio',
|
||||
type => 'f',
|
||||
|
@ -351,6 +355,9 @@ sub validate {
|
|||
# --skirt-height
|
||||
die "Invalid value for --skirt-height\n"
|
||||
if $Slic3r::skirt_height < 1;
|
||||
|
||||
# legacy with existing config files
|
||||
$Slic3r::bridge_feed_rate ||= $Slic3r::print_feed_rate;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
@ -5,6 +5,9 @@ use XXX;
|
|||
|
||||
extends 'Slic3r::Polyline::Closed';
|
||||
|
||||
# perimeter/fill/bridge/skirt
|
||||
has 'role' => (is => 'ro', required => 1);
|
||||
|
||||
sub split_at {
|
||||
my $self = shift;
|
||||
my ($point) = @_;
|
||||
|
@ -25,7 +28,7 @@ sub split_at {
|
|||
push @new_points, @{$self->points}[$i .. $#{$self->points}];
|
||||
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;
|
||||
|
|
|
@ -7,6 +7,9 @@ extends 'Slic3r::Polyline';
|
|||
# expressed in layers
|
||||
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 XXX;
|
||||
|
||||
|
@ -67,7 +70,12 @@ sub split_at_acute_angles {
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -152,6 +160,7 @@ sub detect_arcs {
|
|||
|
||||
my $arc = Slic3r::ExtrusionPath::Arc->new(
|
||||
points => [@arc_points],
|
||||
role => $self->role,
|
||||
orientation => $orientation,
|
||||
center => $arc_center,
|
||||
radius => $arc_center->distance_to($points[$i]),
|
||||
|
|
|
@ -80,10 +80,10 @@ sub make_fill {
|
|||
my $filler = $Slic3r::fill_pattern;
|
||||
my $density = $Slic3r::fill_density;
|
||||
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
|
||||
if ($surface->surface_type ne 'internal') {
|
||||
my $is_bridge = $layer->id > 0 && $surface->surface_type eq 'bottom';
|
||||
$density = 1;
|
||||
$filler = $is_bridge ? 'rectilinear' : $Slic3r::solid_fill_pattern;
|
||||
$flow_width = $Slic3r::nozzle_diameter if $is_bridge;
|
||||
|
@ -102,6 +102,7 @@ sub make_fill {
|
|||
paths => [
|
||||
map Slic3r::ExtrusionPath->cast(
|
||||
[ @$_ ],
|
||||
role => ($is_bridge ? 'bridge' : 'fill'),
|
||||
depth_layers => $surface->depth_layers,
|
||||
), @paths,
|
||||
],
|
||||
|
|
|
@ -35,7 +35,7 @@ sub fill_surface {
|
|||
# make paths
|
||||
my @paths = ();
|
||||
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
|
||||
$cur_pos = $loop->nearest_point_to($cur_pos);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ sub new {
|
|||
},
|
||||
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 => {
|
||||
title => 'Accuracy',
|
||||
|
|
|
@ -64,12 +64,12 @@ sub make_perimeter {
|
|||
foreach my $island (@perimeters) {
|
||||
# do holes starting from innermost one
|
||||
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
|
||||
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--) {
|
||||
my $distance = ($Slic3r::skirt_distance + ($Slic3r::flow_width * $i)) / $Slic3r::resolution;
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue