Skip to content

Commit

Permalink
Optimize honeycomb travels
Browse files Browse the repository at this point in the history
  • Loading branch information
alranel committed Jun 24, 2012
1 parent a6dca1d commit f88f516
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Slic3r/Fill/Honeycomb.pm
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ sub fill_surface {
$self->cache->{$cache_id} = [@polygons];
}

my $loops = intersection_ex(
my @paths = map Slic3r::Polyline->new(@$_, $_->[0]), map @$_, @{intersection_ex(
$self->cache->{$cache_id},
[ map @$_, $expolygon->offset_ex($overlap_distance) ],
)};
my $collection = Slic3r::ExtrusionPath::Collection->new(
paths => [ map Slic3r::ExtrusionPath->new(polyline => $_, role => -1), @paths ],
);
my @paths = map [ @$_, $_->[0] ], map @$_, @$loops;

return {}, @paths;
return {}, map $_->polyline, $collection->shortest_path;
}

1;

0 comments on commit f88f516

Please sign in to comment.