mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-27 10:41:15 -06:00
Enhanced volumes manipulation - wip
This commit is contained in:
parent
a72470079d
commit
22dbcbcd9c
5 changed files with 35 additions and 8 deletions
|
|
@ -1177,10 +1177,12 @@ void ModelVolume::set_material(t_model_material_id material_id, const ModelMater
|
|||
}
|
||||
|
||||
#if ENABLE_MODELVOLUME_TRANSFORM
|
||||
void ModelVolume::translate_geometry(const Vec3d& displacement)
|
||||
void ModelVolume::center_geometry()
|
||||
{
|
||||
mesh.translate((float)displacement(0), (float)displacement(1), (float)displacement(2));
|
||||
m_convex_hull.translate((float)displacement(0), (float)displacement(1), (float)displacement(2));
|
||||
Vec3d shift = -mesh.bounding_box().center();
|
||||
mesh.translate((float)shift(0), (float)shift(1), (float)shift(2));
|
||||
m_convex_hull.translate((float)shift(0), (float)shift(1), (float)shift(2));
|
||||
translate(-shift);
|
||||
}
|
||||
#endif // ENABLE_MODELVOLUME_TRANSFORM
|
||||
|
||||
|
|
|
|||
|
|
@ -324,7 +324,8 @@ public:
|
|||
void mirror(Axis axis);
|
||||
|
||||
#if ENABLE_MODELVOLUME_TRANSFORM
|
||||
void translate_geometry(const Vec3d& displacement);
|
||||
// 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();
|
||||
#endif // ENABLE_MODELVOLUME_TRANSFORM
|
||||
|
||||
void calculate_convex_hull();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue