mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-26 18:21:18 -06:00
Check if object's size appears to be zero, when loading the model file.
This commit is contained in:
parent
7340488aaf
commit
c15be26bff
3 changed files with 25 additions and 0 deletions
|
|
@ -513,6 +513,22 @@ void Model::convert_from_meters(bool only_small_volumes)
|
|||
}
|
||||
}
|
||||
|
||||
static constexpr const double zero_volume = 0.0000000001;
|
||||
|
||||
int Model::removed_objects_with_zero_volume()
|
||||
{
|
||||
if (objects.size() == 0)
|
||||
return 0;
|
||||
|
||||
int removed = 0;
|
||||
for (int i = int(objects.size()) - 1; i >= 0; i--)
|
||||
if (objects[i]->get_object_stl_stats().volume < zero_volume) {
|
||||
delete_object(size_t(i));
|
||||
removed++;
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
void Model::adjust_min_z()
|
||||
{
|
||||
if (objects.empty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue