Better clipping of honeycomb paths

new-support2
Alessandro Ranellucci 2013-03-26 13:04:57 +01:00
parent 4cb36fcbe2
commit 769ec0cb03
1 changed files with 6 additions and 5 deletions

View File

@ -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;