mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-12 06:09:07 +08:00
Merge remote-tracking branch 'remotes/origin/3mf_io'
This commit is contained in:
commit
08bea91197
File diff suppressed because it is too large
Load Diff
@ -409,6 +409,25 @@ void Model::convert_multipart_object()
|
|||||||
this->objects.push_back(object);
|
this->objects.push_back(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Model::adjust_min_z()
|
||||||
|
{
|
||||||
|
if (objects.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (bounding_box().min.z < 0.0)
|
||||||
|
{
|
||||||
|
for (ModelObject* obj : objects)
|
||||||
|
{
|
||||||
|
if (obj != nullptr)
|
||||||
|
{
|
||||||
|
coordf_t obj_min_z = obj->bounding_box().min.z;
|
||||||
|
if (obj_min_z < 0.0)
|
||||||
|
obj->translate(0.0, 0.0, -obj_min_z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ModelObject::ModelObject(Model *model, const ModelObject &other, bool copy_volumes) :
|
ModelObject::ModelObject(Model *model, const ModelObject &other, bool copy_volumes) :
|
||||||
name(other.name),
|
name(other.name),
|
||||||
input_file(other.input_file),
|
input_file(other.input_file),
|
||||||
@ -671,7 +690,10 @@ void ModelObject::transform(const float* matrix3x4)
|
|||||||
v->mesh.transform(matrix3x4);
|
v->mesh.transform(matrix3x4);
|
||||||
}
|
}
|
||||||
|
|
||||||
origin_translation = Pointf3(0.0f, 0.0f, 0.0f);
|
//#####################################################################################################
|
||||||
|
origin_translation = Pointf3(0.0, 0.0, 0.0);
|
||||||
|
// origin_translation = Pointf3(0.0f, 0.0f, 0.0f);
|
||||||
|
//#####################################################################################################
|
||||||
invalidate_bounding_box();
|
invalidate_bounding_box();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,6 +273,9 @@ public:
|
|||||||
bool looks_like_multipart_object() const;
|
bool looks_like_multipart_object() const;
|
||||||
void convert_multipart_object();
|
void convert_multipart_object();
|
||||||
|
|
||||||
|
// Ensures that the min z of the model is not negative
|
||||||
|
void adjust_min_z();
|
||||||
|
|
||||||
void print_info() const { for (const ModelObject *o : this->objects) o->print_info(); }
|
void print_info() const { for (const ModelObject *o : this->objects) o->print_info(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user