Bugfix: manifoldness error triggered with multi-volume AMF files. #1019

This commit is contained in:
Alessandro Ranellucci 2013-02-24 18:17:08 +01:00
parent bd76e7677c
commit 7412d4a687
2 changed files with 9 additions and 1 deletions

View File

@ -1088,7 +1088,7 @@ sub _trigger_model_object {
sub check_manifoldness {
my $self = shift;
$self->is_manifold($self->get_model_object->mesh->check_manifoldness);
$self->is_manifold($self->get_model_object->check_manifoldness);
return $self->is_manifold;
}

View File

@ -73,6 +73,7 @@ has 'attributes' => (is => 'rw', default => sub { {} });
package Slic3r::Model::Object;
use Moo;
use List::Util qw(first);
use Slic3r::Geometry qw(X Y Z);
has 'input_file' => (is => 'rw');
@ -112,6 +113,8 @@ sub add_instance {
sub mesh {
my $self = shift;
# this mesh won't be suitable for check_manifoldness as multiple
# facets from different volumes may use the same vertices
return Slic3r::TriangleMesh->new(
vertices => $self->vertices,
facets => [ map @{$_->facets}, @{$self->volumes} ],
@ -136,6 +139,11 @@ sub materials_count {
return scalar keys %materials;
}
sub check_manifoldness {
my $self = shift;
return (first { !$_->mesh->check_manifoldness } @{$self->volumes}) ? 0 : 1;
}
package Slic3r::Model::Volume;
use Moo;