Ported ExPolygon->contour and ExPolygon->holes

This commit is contained in:
Alessandro Ranellucci 2013-08-26 23:09:18 +02:00
parent 85011dfef3
commit da0b85c0d9
7 changed files with 14 additions and 18 deletions

View file

@ -150,7 +150,7 @@ sub BUILD {
points => [ values %{$self->_pointmap} ],
no_arrows => 1,
expolygons => $self->islands,
#red_polygons => [ map $_->holes, map @$_, @{$self->_inner} ],
#red_polygons => [ map @{$_->holes}, map @$_, @{$self->_inner} ],
#white_polygons => [ map @$_, @{$self->_outer} ],
);
printf "%d islands\n", scalar @{$self->islands};
@ -195,7 +195,7 @@ sub find_node {
# if we're inside a hole, move to a point on hole;
{
my $polygon = first { $_->encloses_point($point) } (map $_->holes, map @$_, @{$self->_inner});
my $polygon = first { $_->encloses_point($point) } (map @{$_->holes}, map @$_, @{$self->_inner});
return nearest_point($point, $polygon) if $polygon;
}