From b360b2bcea40168499242ec43bfbb8cf2c5ac1f8 Mon Sep 17 00:00:00 2001
From: Alessandro Ranellucci <aar@cpan.org>
Date: Sat, 19 May 2012 21:57:47 +0200
Subject: [PATCH] Fixed regression causing side gaps in solid infill

---
 lib/Slic3r/Fill/Rectilinear.pm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/Slic3r/Fill/Rectilinear.pm b/lib/Slic3r/Fill/Rectilinear.pm
index ad6a82e45..f7133f7b3 100644
--- a/lib/Slic3r/Fill/Rectilinear.pm
+++ b/lib/Slic3r/Fill/Rectilinear.pm
@@ -14,9 +14,10 @@ sub fill_surface {
     my $rotate_vector = $self->infill_direction($surface);
     $self->rotate_points($expolygon, $rotate_vector);
     
-    my ($expolygon_off) = $expolygon->offset_ex(scale 0.2);
+    my ($expolygon_off) = $expolygon->offset_ex(scale 0.3);
     return {} if !$expolygon_off;  # skip some very small polygons (which shouldn't arrive here)
-    my $bounding_box = [ $expolygon_off->bounding_box ];
+    my ($expolygon_epsilon_off) = $expolygon->offset_ex(scale epsilon);
+    my $bounding_box = [ $expolygon->bounding_box ];
     
     my $min_spacing = scale $params{flow_spacing};
     my $distance_between_lines = $min_spacing / $params{density};
@@ -46,7 +47,7 @@ sub fill_surface {
         $x += $distance_between_lines;
     }
     my @paths = @{ Boost::Geometry::Utils::polygon_linestring_intersection(
-        $expolygon->boost_polygon,
+        $expolygon_epsilon_off->boost_polygon,
         Boost::Geometry::Utils::linestring(@vertical_lines),
     ) };
     for (@paths) {