Bugfix: manifoldness error triggered with multi-volume AMF files. #1019
This commit is contained in:
parent
bd76e7677c
commit
7412d4a687
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user