mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 07:03:59 -06:00
Bugfix: fill escapes perimeters. #139
This commit is contained in:
parent
4a4c4b4e7d
commit
be9886eac3
3 changed files with 20 additions and 9 deletions
|
@ -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) = @_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue