mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-05 19:42:47 +00:00
Fixed loading of huge models
This commit is contained in:
@@ -983,6 +983,16 @@ void ModelObject::mirror(Axis axis)
|
||||
this->invalidate_bounding_box();
|
||||
}
|
||||
|
||||
void ModelObject::scale_mesh(const Vec3d &versor)
|
||||
{
|
||||
for (ModelVolume *v : this->volumes)
|
||||
{
|
||||
v->scale_geometry(versor);
|
||||
v->set_offset(versor.cwiseProduct(v->get_offset()));
|
||||
}
|
||||
this->invalidate_bounding_box();
|
||||
}
|
||||
|
||||
size_t ModelObject::materials_count() const
|
||||
{
|
||||
std::set<t_model_material_id> material_ids;
|
||||
@@ -1514,6 +1524,12 @@ void ModelVolume::mirror(Axis axis)
|
||||
#endif // ENABLE_MODELVOLUME_TRANSFORM
|
||||
}
|
||||
|
||||
void ModelVolume::scale_geometry(const Vec3d& versor)
|
||||
{
|
||||
mesh.scale(versor);
|
||||
m_convex_hull.scale(versor);
|
||||
}
|
||||
|
||||
#if !ENABLE_MODELVOLUME_TRANSFORM
|
||||
void ModelInstance::set_rotation(const Vec3d& rotation)
|
||||
{
|
||||
|
||||
@@ -237,6 +237,9 @@ public:
|
||||
void rotate(double angle, Axis axis);
|
||||
void rotate(double angle, const Vec3d& axis);
|
||||
void mirror(Axis axis);
|
||||
|
||||
void scale_mesh(const Vec3d& versor);
|
||||
|
||||
size_t materials_count() const;
|
||||
size_t facets_count() const;
|
||||
bool needed_repair() const;
|
||||
@@ -331,6 +334,8 @@ public:
|
||||
void rotate(double angle, const Vec3d& axis);
|
||||
void mirror(Axis axis);
|
||||
|
||||
void scale_geometry(const Vec3d& versor);
|
||||
|
||||
#if ENABLE_MODELVOLUME_TRANSFORM
|
||||
// translates the mesh and the convex hull so that the origin of their vertices is in the center of this volume's bounding box
|
||||
void center_geometry();
|
||||
|
||||
Reference in New Issue
Block a user