mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-30 10:04:35 +08:00
Fixed get_object_stl_stats()
This commit is contained in:
parent
88c9948c85
commit
d2107fad2f
@ -1456,28 +1456,28 @@ stl_stats ModelObject::get_object_stl_stats() const
|
|||||||
if (this->volumes.size() == 1)
|
if (this->volumes.size() == 1)
|
||||||
return this->volumes[0]->mesh.stl.stats;
|
return this->volumes[0]->mesh.stl.stats;
|
||||||
|
|
||||||
stl_stats full_stats;
|
stl_stats full_stats = this->volumes[0]->mesh.stl.stats;
|
||||||
|
|
||||||
// initialise full_stats
|
|
||||||
full_stats.degenerate_facets= 0;
|
|
||||||
full_stats.edges_fixed = 0;
|
|
||||||
full_stats.facets_removed = 0;
|
|
||||||
full_stats.facets_added = 0;
|
|
||||||
full_stats.facets_reversed = 0;
|
|
||||||
full_stats.backwards_edges = 0;
|
|
||||||
full_stats.normals_fixed = 0;
|
|
||||||
|
|
||||||
// fill full_stats from all objet's meshes
|
// fill full_stats from all objet's meshes
|
||||||
for (ModelVolume* volume : this->volumes)
|
for (ModelVolume* volume : this->volumes)
|
||||||
{
|
{
|
||||||
|
if (volume->id() == this->volumes[0]->id())
|
||||||
|
continue;
|
||||||
|
|
||||||
const stl_stats& stats = volume->mesh.stl.stats;
|
const stl_stats& stats = volume->mesh.stl.stats;
|
||||||
|
|
||||||
|
// initialize full_stats (for repaired errors)
|
||||||
full_stats.degenerate_facets+= stats.degenerate_facets;
|
full_stats.degenerate_facets+= stats.degenerate_facets;
|
||||||
full_stats.edges_fixed += stats.edges_fixed;
|
full_stats.edges_fixed += stats.edges_fixed;
|
||||||
full_stats.facets_removed += stats.facets_removed;
|
full_stats.facets_removed += stats.facets_removed;
|
||||||
full_stats.facets_added += stats.facets_added;
|
full_stats.facets_added += stats.facets_added;
|
||||||
full_stats.facets_reversed += stats.facets_reversed;
|
full_stats.facets_reversed += stats.facets_reversed;
|
||||||
full_stats.backwards_edges += stats.backwards_edges;
|
full_stats.backwards_edges += stats.backwards_edges;
|
||||||
|
|
||||||
|
// another used satistics value
|
||||||
|
if (volume->is_model_part())
|
||||||
|
full_stats.volume += stats.volume;
|
||||||
|
full_stats.number_of_parts += stats.number_of_parts;
|
||||||
}
|
}
|
||||||
|
|
||||||
return full_stats;
|
return full_stats;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user