mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-05 13:04:03 -06:00
Some infill paths were still disconnected, causing unnecessary retractions
This commit is contained in:
parent
ee41345ab0
commit
5281b101f9
2 changed files with 14 additions and 8 deletions
|
@ -6,7 +6,7 @@ use warnings;
|
|||
|
||||
use Boost::Geometry::Utils;
|
||||
use Math::Geometry::Voronoi;
|
||||
use Slic3r::Geometry qw(X Y A B point_in_polygon same_line);
|
||||
use Slic3r::Geometry qw(X Y A B point_in_polygon same_line line_length);
|
||||
use Slic3r::Geometry::Clipper qw(union_ex JT_MITER);
|
||||
|
||||
# the constructor accepts an array of polygons
|
||||
|
@ -110,10 +110,14 @@ sub encloses_point_quick {
|
|||
|
||||
sub encloses_line {
|
||||
my $self = shift;
|
||||
my ($line) = @_;
|
||||
|
||||
my ($line, $tolerance) = @_;
|
||||
my $clip = $self->clip_line($line);
|
||||
return @$clip == 1 && same_line($clip->[0], $line);
|
||||
if (!defined $tolerance) {
|
||||
# optimization
|
||||
return @$clip == 1 && same_line($clip->[0], $line);
|
||||
} else {
|
||||
return @$clip == 1 && abs(line_length($clip->[0]) - $line->length) < $tolerance;
|
||||
}
|
||||
}
|
||||
|
||||
sub point_on_segment {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue