Fixed manipulation of sinking multipart objects resulting in wrong object/parts positioning

This commit is contained in:
enricoturri1966 2021-08-25 15:01:15 +02:00
parent a918314aab
commit ca098d5763
3 changed files with 28 additions and 6 deletions
src/libslic3r

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)