Avoid merging meshes when there is only one mesh to merge.
When slicing yoda.stl it reduces peak memory usage by 5% and speeds up slicing by 13%. Further optimization using a simple proxy to implement the two methods (size/extends) needed on the merge meshes is also possible and undoubtedly worthwhile.
This commit is contained in:
parent
407de02fe4
commit
aac2c45450
1 changed files with 2 additions and 1 deletions
|
@ -118,7 +118,8 @@ sub add_model {
|
|||
$mesh->scale($Slic3r::Config->scale / &Slic3r::SCALING_FACTOR);
|
||||
}
|
||||
|
||||
my $complete_mesh = Slic3r::TriangleMesh->merge(grep defined $_, @meshes);
|
||||
my @defined_meshes = grep defined $_, @meshes;
|
||||
my $complete_mesh = @defined_meshes == 1 ? $defined_meshes[0] : Slic3r::TriangleMesh->merge(@defined_meshes);
|
||||
|
||||
# initialize print object
|
||||
my $print_object = Slic3r::Print::Object->new(
|
||||
|
|
Loading…
Reference in a new issue