From 4af295bce3bed7b938f0857bcd50ee97c7a31b2c Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 19 Dec 2011 09:55:03 +0100 Subject: [PATCH] Bugfix: very wrong infill for low density regions. #127 --- lib/Slic3r/Fill/Concentric.pm | 13 ++++++++----- lib/Slic3r/Fill/Rectilinear.pm | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/lib/Slic3r/Fill/Concentric.pm b/lib/Slic3r/Fill/Concentric.pm index 549e33324..718bddd9f 100644 --- a/lib/Slic3r/Fill/Concentric.pm +++ b/lib/Slic3r/Fill/Concentric.pm @@ -18,11 +18,14 @@ sub fill_surface { my $min_spacing = scale $params{flow_spacing}; my $distance = $min_spacing / $params{density}; - $distance = $self->adjust_solid_spacing( - width => $bounding_box->[X2] - $bounding_box->[X1], - distance => $distance, - ) if $params{density} == 1; - my $flow_spacing = unscale $distance; + my $flow_spacing; + if ($params{density} == 1) { + $distance = $self->adjust_solid_spacing( + width => $bounding_box->[X2] - $bounding_box->[X1], + distance => $distance, + ); + $flow_spacing = unscale $distance; + } my @contour_loops = (); my @hole_loops = (); diff --git a/lib/Slic3r/Fill/Rectilinear.pm b/lib/Slic3r/Fill/Rectilinear.pm index 8eaa3ba08..103e2f835 100644 --- a/lib/Slic3r/Fill/Rectilinear.pm +++ b/lib/Slic3r/Fill/Rectilinear.pm @@ -23,11 +23,14 @@ sub fill_surface { my $distance_between_lines = $min_spacing / $params{density}; my $line_oscillation = $distance_between_lines - $min_spacing; - $distance_between_lines = $self->adjust_solid_spacing( - width => $bounding_box->[X2] - $bounding_box->[X1], - distance => $distance_between_lines, - ) if $params{density} == 1; - my $flow_spacing = unscale $distance_between_lines; + my $flow_spacing; + if ($params{density} == 1) { + $distance_between_lines = $self->adjust_solid_spacing( + width => $bounding_box->[X2] - $bounding_box->[X1], + distance => $distance_between_lines, + ); + $flow_spacing = unscale $distance_between_lines; + } my $overlap_distance = $Slic3r::nozzle_diameter * 0.20;