Rectilinear fill

This commit is contained in:
Alessandro Ranellucci 2011-09-05 12:21:27 +02:00
parent 428006264d
commit 9e111d0a6d
11 changed files with 317 additions and 33 deletions

View file

@ -45,6 +45,11 @@ sub id {
return $self->a->id . "-" . $self->b->id;
}
sub coordinates {
my $self = shift;
return ($self->a->coordinates, $self->b->coordinates);
}
sub coincides_with {
my $self = shift;
my ($line) = @_;
@ -55,7 +60,7 @@ sub coincides_with {
sub has_endpoint {
my $self = shift;
my ($point) = @_;#printf " %s has endpoint %s: %s\n", $self->id, $point->id, ($point eq $self->a || $point eq $self->b);
my ($point) = @_;
return $point->coincides_with($self->a) || $point->coincides_with($self->b);
}