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

@ -20,6 +20,8 @@ has 'holes' => (
},
);
# TODO: to allow for multiple solid skins to be filled near external
# surfaces, a new type should be defined: internal-solid
has 'surface_type' => (
is => 'rw',
isa => enum([qw(internal bottom top)]),
@ -44,7 +46,7 @@ sub BUILD {
sub new_from_mgp {
my $self = shift;
my ($polygon) = @_;
my ($polygon, %params) = @_;
my ($contour_p, @holes_p) = @{ $polygon->polygons };
@ -53,6 +55,7 @@ sub new_from_mgp {
holes => [
map Slic3r::Polyline::Closed->new_from_points(@$_), @holes_p
],
%params,
);
}
@ -78,4 +81,9 @@ sub mgp_polygon {
return $p;
}
sub lines {
my $self = shift;
return @{ $self->contour->lines }, map @{ $_->lines }, @{ $self->holes };
}
1;