Generate a better error when input file is too thin and no layers could be generated. #1127
This commit is contained in:
parent
086ec4af9c
commit
8a01cb9e96
@ -184,13 +184,13 @@ sub slice {
|
|||||||
|
|
||||||
$self->meshes->[$region_id] = undef; # free memory
|
$self->meshes->[$region_id] = undef; # free memory
|
||||||
}
|
}
|
||||||
die "Invalid input file\n" if !@{$self->layers};
|
|
||||||
|
|
||||||
# free memory
|
# free memory
|
||||||
$self->meshes(undef);
|
$self->meshes(undef);
|
||||||
|
|
||||||
# remove last layer(s) if empty
|
# remove last layer(s) if empty
|
||||||
pop @{$self->layers} while !map @{$_->lines}, @{$self->layers->[-1]->regions};
|
pop @{$self->layers} while @{$self->layers} && (!map @{$_->lines}, @{$self->layers->[-1]->regions});
|
||||||
|
die "Invalid or too thin input file: no layers could be generated\n" if !@{$self->layers};
|
||||||
|
|
||||||
foreach my $layer (@{ $self->layers }) {
|
foreach my $layer (@{ $self->layers }) {
|
||||||
# make sure all layers contain layer region objects for all regions
|
# make sure all layers contain layer region objects for all regions
|
||||||
|
Loading…
Reference in New Issue
Block a user