mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
Tech ENABLE_ALLOW_NEGATIVE_Z -> Allow move gizmo to place an object under the printbed
This commit is contained in:
parent
49928e131c
commit
c8b83ae011
2 changed files with 15 additions and 0 deletions
|
@ -59,6 +59,8 @@
|
||||||
#define ENABLE_EXTENDED_M73_LINES (1 && ENABLE_VALIDATE_CUSTOM_GCODE)
|
#define ENABLE_EXTENDED_M73_LINES (1 && ENABLE_VALIDATE_CUSTOM_GCODE)
|
||||||
// Enable a modified version of automatic downscale on load of objects too big
|
// Enable a modified version of automatic downscale on load of objects too big
|
||||||
#define ENABLE_MODIFIED_DOWNSCALE_ON_LOAD_OBJECTS_TOO_BIG (1 && ENABLE_2_4_0_ALPHA0)
|
#define ENABLE_MODIFIED_DOWNSCALE_ON_LOAD_OBJECTS_TOO_BIG (1 && ENABLE_2_4_0_ALPHA0)
|
||||||
|
// Enable to push object instances under the bed
|
||||||
|
#define ENABLE_ALLOW_NEGATIVE_Z (1 && ENABLE_2_4_0_ALPHA0)
|
||||||
|
|
||||||
|
|
||||||
#endif // _prusaslicer_technologies_h_
|
#endif // _prusaslicer_technologies_h_
|
||||||
|
|
|
@ -3572,12 +3572,25 @@ void GLCanvas3D::do_move(const std::string& snapshot_type)
|
||||||
wipe_tower_origin = v->get_volume_offset();
|
wipe_tower_origin = v->get_volume_offset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLE_ALLOW_NEGATIVE_Z
|
||||||
|
// Fixes flying instances
|
||||||
|
#else
|
||||||
// Fixes sinking/flying instances
|
// Fixes sinking/flying instances
|
||||||
|
#endif // ENABLE_ALLOW_NEGATIVE_Z
|
||||||
for (const std::pair<int, int>& i : done) {
|
for (const std::pair<int, int>& i : done) {
|
||||||
ModelObject* m = m_model->objects[i.first];
|
ModelObject* m = m_model->objects[i.first];
|
||||||
|
#if ENABLE_ALLOW_NEGATIVE_Z
|
||||||
|
double shift_z = m->get_instance_min_z(i.second);
|
||||||
|
if (shift_z > 0.0) {
|
||||||
|
Vec3d shift(0.0, 0.0, -shift_z);
|
||||||
|
#else
|
||||||
Vec3d shift(0.0, 0.0, -m->get_instance_min_z(i.second));
|
Vec3d shift(0.0, 0.0, -m->get_instance_min_z(i.second));
|
||||||
|
#endif // ENABLE_ALLOW_NEGATIVE_Z
|
||||||
m_selection.translate(i.first, i.second, shift);
|
m_selection.translate(i.first, i.second, shift);
|
||||||
m->translate_instance(i.second, shift);
|
m->translate_instance(i.second, shift);
|
||||||
|
#if ENABLE_ALLOW_NEGATIVE_Z
|
||||||
|
}
|
||||||
|
#endif // ENABLE_ALLOW_NEGATIVE_Z
|
||||||
}
|
}
|
||||||
|
|
||||||
if (object_moved)
|
if (object_moved)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue