From a2b4f9f671be27858bbfd130d1e61321717663db Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 13 Nov 2011 18:21:25 +0100 Subject: [PATCH] Use nozzle diameter as flow width when bridging --- lib/Slic3r/Fill.pm | 14 ++++++++------ lib/Slic3r/Fill/PlanePath.pm | 2 +- lib/Slic3r/Fill/Rectilinear.pm | 2 +- lib/Slic3r/Fill/Rectilinear2.pm | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/Slic3r/Fill.pm b/lib/Slic3r/Fill.pm index 35bd4e94e..579e07682 100644 --- a/lib/Slic3r/Fill.pm +++ b/lib/Slic3r/Fill.pm @@ -46,22 +46,24 @@ sub make_fill { SURFACE: foreach my $surface (@$surfaces) { Slic3r::debugf " Processing surface %s:\n", $surface->id; - my $filler = $Slic3r::fill_pattern; - my $density = $Slic3r::fill_density; + my $filler = $Slic3r::fill_pattern; + my $density = $Slic3r::fill_density; + my $flow_width = $Slic3r::flow_width; # force 100% density and rectilinear fill for external surfaces if ($surface->surface_type ne 'internal') { + my $is_bridge = $surface->isa('Slic3r::Surface::Bridge'); $density = 1; - $filler = $surface->isa('Slic3r::Surface::Bridge') - ? 'rectilinear' - : $Slic3r::solid_fill_pattern; + $filler = $is_bridge ? 'rectilinear' : $Slic3r::solid_fill_pattern; + $flow_width = $Slic3r::nozzle_diameter if $is_bridge; } else { next SURFACE unless $density > 0; } my @paths = $self->fillers->{$filler}->fill_surface( $surface, - density => $density, + density => $density, + flow_width => $flow_width, ); push @path_collection, map Slic3r::ExtrusionPath->cast( diff --git a/lib/Slic3r/Fill/PlanePath.pm b/lib/Slic3r/Fill/PlanePath.pm index 45a00ceca..d0e3ce6c2 100644 --- a/lib/Slic3r/Fill/PlanePath.pm +++ b/lib/Slic3r/Fill/PlanePath.pm @@ -27,7 +27,7 @@ sub fill_surface { my $rotate_vector = $self->infill_direction($surface); $self->rotate_points($expolygon, $rotate_vector); - my $distance_between_lines = $Slic3r::flow_width / $Slic3r::resolution / $params{density} * $self->multiplier; + my $distance_between_lines = $params{flow_width} / $Slic3r::resolution / $params{density} * $self->multiplier; my $bounding_box = [ bounding_box(map @$_, $expolygon) ]; (ref $self) =~ /::([^:]+)$/; diff --git a/lib/Slic3r/Fill/Rectilinear.pm b/lib/Slic3r/Fill/Rectilinear.pm index 28fb884b7..039865312 100644 --- a/lib/Slic3r/Fill/Rectilinear.pm +++ b/lib/Slic3r/Fill/Rectilinear.pm @@ -16,7 +16,7 @@ sub fill_surface { $self->rotate_points($expolygon, $rotate_vector); my $bounding_box = [ $expolygon->bounding_box ]; - my $distance_between_lines = $Slic3r::flow_width / $Slic3r::resolution / $params{density}; + my $distance_between_lines = $params{flow_width} / $Slic3r::resolution / $params{density}; my @paths = (); my $x = $bounding_box->[X1]; diff --git a/lib/Slic3r/Fill/Rectilinear2.pm b/lib/Slic3r/Fill/Rectilinear2.pm index f2e210bf7..7d741e65e 100644 --- a/lib/Slic3r/Fill/Rectilinear2.pm +++ b/lib/Slic3r/Fill/Rectilinear2.pm @@ -16,7 +16,7 @@ sub fill_surface { my $rotate_vector = $self->infill_direction($surface); $self->rotate_points($polygons, $rotate_vector); - my $distance_between_lines = $Slic3r::flow_width / $Slic3r::resolution / $params{density}; + my $distance_between_lines = $params{flow_width} / $Slic3r::resolution / $params{density}; my $number_of_lines = int(0.99999999 + $self->max_print_dimension / $distance_between_lines); # ceil #printf "distance = %f\n", $distance_between_lines;