mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-21 01:42:09 +00:00
Check if object's size appears to be zero, when loading the model file.
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user