From 769ec0cb030b0705cd50003ec12d02ef7ac03c1e Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 26 Mar 2013 13:04:57 +0100 Subject: [PATCH] Better clipping of honeycomb paths --- lib/Slic3r/Fill/Honeycomb.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/Slic3r/Fill/Honeycomb.pm b/lib/Slic3r/Fill/Honeycomb.pm index 9e4ff8a27c..a2386d6038 100644 --- a/lib/Slic3r/Fill/Honeycomb.pm +++ b/lib/Slic3r/Fill/Honeycomb.pm @@ -78,13 +78,14 @@ sub fill_surface { $self->cache->{$cache_id} = [@polygons]; } - # build polylines from polygons without re-appending the initial point: + # consider polygons as polylines without re-appending the initial point: # this cuts the last segment on purpose, so that the jump to the next # path is more straight - my @paths = map Slic3r::Polyline->new(@$_), map @$_, @{intersection_ex( - $self->cache->{$cache_id}, - $expolygon, - )}; + my @paths = map Slic3r::Polyline->new($_), + @{ Boost::Geometry::Utils::polygon_multi_linestring_intersection( + $expolygon, + $self->cache->{$cache_id}, + ) }; return { flow_spacing => $params{flow_spacing} }, Slic3r::Polyline::Collection->new(polylines => \@paths)->chained_path;