mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 11:02:08 +00:00
Bugfix: fill escapes perimeters. #139
This commit is contained in:
@@ -5,7 +5,7 @@ use warnings;
|
||||
# an ExPolygon is a polygon with holes
|
||||
|
||||
use Math::Geometry::Voronoi;
|
||||
use Slic3r::Geometry qw(X Y A B point_in_polygon);
|
||||
use Slic3r::Geometry qw(X Y A B point_in_polygon same_line);
|
||||
use Slic3r::Geometry::Clipper qw(union_ex JT_MITER);
|
||||
|
||||
# the constructor accepts an array of polygons
|
||||
@@ -93,6 +93,14 @@ sub encloses_point {
|
||||
|| grep($_->point_on_segment($point), $self->holes));
|
||||
}
|
||||
|
||||
sub encloses_line {
|
||||
my $self = shift;
|
||||
my ($line) = @_;
|
||||
|
||||
my $clip = $self->clip_line($line);
|
||||
return @$clip == 1 && same_line($clip->[0], $line);
|
||||
}
|
||||
|
||||
sub point_on_segment {
|
||||
my $self = shift;
|
||||
my ($point) = @_;
|
||||
|
||||
Reference in New Issue
Block a user