Merge branch 'master' into fs_QuadricEdgeCollapse

This commit is contained in:
Filip Sykala 2021-08-25 16:56:24 +02:00
commit 9ea3be485f
14 changed files with 91 additions and 111 deletions

View file

@ -959,7 +959,7 @@ void ModelObject::ensure_on_bed(bool allow_negative_z)
double z_offset = 0.0;
if (allow_negative_z) {
if (volumes.size() == 1)
if (parts_count() == 1)
z_offset = -get_min_z();
else {
const double max_z = get_max_z();
@ -1127,6 +1127,15 @@ size_t ModelObject::facets_count() const
return num;
}
size_t ModelObject::parts_count() const
{
size_t num = 0;
for (const ModelVolume* v : this->volumes)
if (v->is_model_part())
++num;
return num;
}
bool ModelObject::needed_repair() const
{
for (const ModelVolume *v : this->volumes)

View file

@ -347,6 +347,7 @@ public:
size_t materials_count() const;
size_t facets_count() const;
size_t parts_count() const;
bool needed_repair() const;
ModelObjectPtrs cut(size_t instance, coordf_t z, ModelObjectCutAttributes attributes);
void split(ModelObjectPtrs* new_objects);