diff --git a/lib/Slic3r/ExPolygon.pm b/lib/Slic3r/ExPolygon.pm index 9a198c48d..383a6d820 100644 --- a/lib/Slic3r/ExPolygon.pm +++ b/lib/Slic3r/ExPolygon.pm @@ -153,10 +153,7 @@ sub clip_line { my $self = shift; my ($line) = @_; # line must be a Slic3r::Line object - return Boost::Geometry::Utils::polygon_linestring_intersection( - $self->boost_polygon, - $line->boost_linestring, - ); + return Boost::Geometry::Utils::polygon_multi_linestring_intersection($self, [$line]); } sub simplify { diff --git a/lib/Slic3r/Fill/Rectilinear.pm b/lib/Slic3r/Fill/Rectilinear.pm index ea9f1ddb0..eb633a74a 100644 --- a/lib/Slic3r/Fill/Rectilinear.pm +++ b/lib/Slic3r/Fill/Rectilinear.pm @@ -48,9 +48,9 @@ sub fill_surface { # clip paths against a slightly offsetted expolygon, so that the first and last paths # are kept even if the expolygon has vertical sides - my @paths = @{ Boost::Geometry::Utils::polygon_linestring_intersection( - +($expolygon->offset_ex(scaled_epsilon))[0]->boost_polygon, # TODO: we should use all the resulting expolygons and clip the linestrings to a multipolygon object - Boost::Geometry::Utils::linestring(@vertical_lines), + my @paths = @{ Boost::Geometry::Utils::polygon_multi_linestring_intersection( + +($expolygon->offset_ex(scaled_epsilon))[0], # TODO: we should use all the resulting expolygons and clip the linestrings to a multipolygon object + [ @vertical_lines ], ) }; for (@paths) { $_->[0][Y] += $overlap_distance; diff --git a/lib/Slic3r/GCode/MotionPlanner.pm b/lib/Slic3r/GCode/MotionPlanner.pm index 810a02ae2..d55faeb2a 100644 --- a/lib/Slic3r/GCode/MotionPlanner.pm +++ b/lib/Slic3r/GCode/MotionPlanner.pm @@ -92,10 +92,7 @@ sub BUILD { my $intersects = sub { my ($polygon, $line) = @_; - @{Boost::Geometry::Utils::polygon_linestring_intersection( - $polygon->boost_polygon, - $line->boost_linestring, - )} > 0; + @{Boost::Geometry::Utils::polygon_multi_linestring_intersection([$polygon], [$line])} > 0; }; { diff --git a/lib/Slic3r/Polyline.pm b/lib/Slic3r/Polyline.pm index 110472400..9d9926c42 100644 --- a/lib/Slic3r/Polyline.pm +++ b/lib/Slic3r/Polyline.pm @@ -115,10 +115,7 @@ sub clip_with_expolygon { my $self = shift; my ($expolygon) = @_; - my $result = Boost::Geometry::Utils::polygon_linestring_intersection( - $expolygon->boost_polygon, - $self->boost_linestring, - ); + my $result = Boost::Geometry::Utils::polygon_multi_linestring_intersection($expolygon, [$self]); bless $_, 'Slic3r::Polyline' for @$result; bless $_, 'Slic3r::Point' for map @$_, @$result; return @$result;