Bugfix: ExPolygon::contains_line() was called with a Polyline object but didn't throw any error. Thanks ledvinap #1945

visilibity
Alessandro Ranellucci 2014-04-19 01:26:21 +02:00
parent 62e19469bc
commit caf20664cd
2 changed files with 7 additions and 2 deletions

View File

@ -175,13 +175,13 @@ sub _add_point_to_space {
# find candidates by checking visibility from $from to them
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 outside an island, it is visible from $idx when their line does not cross any island
if (
($inside && defined first { $_->contains_line($line) } @{$self->_inner})
|| (!$inside && !@{intersection_pl(
[ $line ],
[ $line->as_polyline ],
[ map @$_, @{$self->islands} ],
)})
) {

View File

@ -18,4 +18,9 @@ sub grow {
return Slic3r::Polyline->new(@$self)->grow(@_);
}
sub as_polyline {
my ($self) = @_;
return Slic3r::Polyline->new(@$self);
}
1;