Bugfix: ExPolygon::contains_line() was called with a Polyline object but didn't throw any error. Thanks ledvinap #1945
This commit is contained in:
parent
62e19469bc
commit
caf20664cd
2 changed files with 7 additions and 2 deletions
|
@ -175,13 +175,13 @@ sub _add_point_to_space {
|
||||||
|
|
||||||
# find candidates by checking visibility from $from to them
|
# find candidates by checking visibility from $from to them
|
||||||
foreach my $idx (0..$#{$space->nodes}) {
|
foreach my $idx (0..$#{$space->nodes}) {
|
||||||
my $line = Slic3r::Polyline->new($point, $space->nodes->[$idx]);
|
my $line = Slic3r::Line->new($point, $space->nodes->[$idx]);
|
||||||
# if $point is inside an island, it is visible from $idx when island contains their line
|
# if $point is inside an island, it is visible from $idx when island contains their line
|
||||||
# if $point is outside an island, it is visible from $idx when their line does not cross any island
|
# if $point is outside an island, it is visible from $idx when their line does not cross any island
|
||||||
if (
|
if (
|
||||||
($inside && defined first { $_->contains_line($line) } @{$self->_inner})
|
($inside && defined first { $_->contains_line($line) } @{$self->_inner})
|
||||||
|| (!$inside && !@{intersection_pl(
|
|| (!$inside && !@{intersection_pl(
|
||||||
[ $line ],
|
[ $line->as_polyline ],
|
||||||
[ map @$_, @{$self->islands} ],
|
[ map @$_, @{$self->islands} ],
|
||||||
)})
|
)})
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -18,4 +18,9 @@ sub grow {
|
||||||
return Slic3r::Polyline->new(@$self)->grow(@_);
|
return Slic3r::Polyline->new(@$self)->grow(@_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub as_polyline {
|
||||||
|
my ($self) = @_;
|
||||||
|
return Slic3r::Polyline->new(@$self);
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue