This commit is contained in:
Vojtech Bubnik 2021-11-16 10:18:58 +01:00
commit 58c93196d5
11 changed files with 122 additions and 57 deletions
src/libslic3r

View file

@ -1,3 +1,4 @@
#include "Model.hpp"
#include "libslic3r.h"
#include "BuildVolume.hpp"
#include "Exception.hpp"
@ -1621,9 +1622,6 @@ std::string ModelObject::get_export_filename() const
TriangleMeshStats ModelObject::get_object_stl_stats() const
{
if (this->volumes.size() == 1)
return this->volumes[0]->mesh().stats();
TriangleMeshStats full_stats;
full_stats.volume = 0.f;
@ -1638,7 +1636,8 @@ TriangleMeshStats ModelObject::get_object_stl_stats() const
// another used satistics value
if (volume->is_model_part()) {
full_stats.volume += stats.volume;
Transform3d trans = instances.empty() ? volume->get_matrix() : (volume->get_matrix() * instances[0]->get_matrix());
full_stats.volume += stats.volume * std::fabs(trans.matrix().block(0, 0, 3, 3).determinant());
full_stats.number_of_parts += stats.number_of_parts;
}
}