Fixed regression causing poor adhesion of rectilinear infill to perimeters

This commit is contained in:
Alessandro Ranellucci 2012-05-04 20:51:09 +02:00
parent abe048686b
commit 4b7e9fc284

View file

@ -61,14 +61,14 @@ sub fill_surface {
); );
@paths = (); @paths = ();
my $can_connect = my $tolerance = scale epsilon;
$is_line_pattern ? sub { my $diagonal_distance = $distance_between_lines * 5;
($_[X] >= ($distance_between_lines - $line_oscillation) - epsilon) && ($_[X] <= ($distance_between_lines + $line_oscillation) + epsilon) my $can_connect = $is_line_pattern
&& abs($_[Y]) <= $distance_between_lines * 5 ? sub {
} : sub { ($_[X] >= ($distance_between_lines - $line_oscillation) - $tolerance) && ($_[X] <= ($distance_between_lines + $line_oscillation) + $tolerance)
($_[X] >= $distance_between_lines - epsilon) && ($_[X] <= $distance_between_lines + epsilon) # $_[X] == $distance_between_lines +/- epsilon && abs($_[Y]) <= $diagonal_distance
&& abs($_[Y]) <= $distance_between_lines * 5 }
}; : sub { abs($_[X] - $distance_between_lines) <= $tolerance && abs($_[Y]) <= $diagonal_distance };
foreach my $path ($collection->shortest_path) { foreach my $path ($collection->shortest_path) {
if (@paths) { if (@paths) {