From 53d24bc58074767bf7268a541d4329e682b82536 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 23 Jun 2012 20:27:28 +0200 Subject: [PATCH] Bugfix: some infill paths were not connected. #477 --- lib/Slic3r/Fill/Rectilinear.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/Fill/Rectilinear.pm b/lib/Slic3r/Fill/Rectilinear.pm index 281eaa311..e8adcc6e8 100644 --- a/lib/Slic3r/Fill/Rectilinear.pm +++ b/lib/Slic3r/Fill/Rectilinear.pm @@ -67,13 +67,13 @@ sub fill_surface { my $can_connect = $is_line_pattern ? sub { ($_[X] >= ($distance_between_lines - $line_oscillation) - $tolerance) && ($_[X] <= ($distance_between_lines + $line_oscillation) + $tolerance) - && abs($_[Y]) <= $diagonal_distance + && $_[Y] <= $diagonal_distance } - : sub { abs($_[X] - $distance_between_lines) <= $tolerance && abs($_[Y]) <= $diagonal_distance }; + : sub { abs($_[X]) - $distance_between_lines <= $tolerance && $_[Y] <= $diagonal_distance }; foreach my $path ($collection->shortest_path) { if (@paths) { - my @distance = map +($path->points->[0][$_] - $paths[-1][-1][$_]), (X,Y); + my @distance = map abs($path->points->[0][$_] - $paths[-1][-1][$_]), (X,Y); # TODO: we should also check that both points are on a fill_boundary to avoid # connecting paths on the boundaries of internal regions