diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index 369996fbaf..316cff195a 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -61,6 +61,7 @@ #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) +#define DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA (1 && ENABLE_ALLOW_NEGATIVE_Z) #endif // _prusaslicer_technologies_h_ diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index c64c36ea85..00bad52ff7 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -23,6 +23,9 @@ #include "libslic3r/Format/STL.hpp" #include "libslic3r/Utils.hpp" #include "libslic3r/AppConfig.hpp" +#if DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA +#include "libslic3r/PresetBundle.hpp" +#endif // DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA #include #include @@ -521,7 +524,11 @@ bool GLVolume::is_sla_pad() const { return this->composite_id.volume_id == -int( #if ENABLE_ALLOW_NEGATIVE_Z bool GLVolume::is_sinking() const { +#if DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA + if (is_modifier || GUI::wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA) +#else if (is_modifier) +#endif // DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA return false; const BoundingBoxf3& box = transformed_convex_hull_bounding_box(); return box.min(2) < -EPSILON && box.max(2) >= -EPSILON; diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index cc8658fc27..c8e402a5d7 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3571,7 +3571,11 @@ void GLCanvas3D::do_move(const std::string& snapshot_type) ModelObject* m = m_model->objects[i.first]; #if ENABLE_ALLOW_NEGATIVE_Z double shift_z = m->get_instance_min_z(i.second); +#if DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA + if (m_process->current_printer_technology() == ptSLA || shift_z > 0.0) { +#else if (shift_z > 0.0) { +#endif // DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA Vec3d shift(0.0, 0.0, -shift_z); #else Vec3d shift(0.0, 0.0, -m->get_instance_min_z(i.second)); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 32ecef4381..ab1d657e4a 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -5816,7 +5816,11 @@ void Plater::changed_object(int obj_idx) // recenter and re - align to Z = 0 auto model_object = p->model.objects[obj_idx]; #if ENABLE_ALLOW_NEGATIVE_Z +#if DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA + model_object->ensure_on_bed(this->p->printer_technology != ptSLA); +#else model_object->ensure_on_bed(true); +#endif // DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA #else model_object->ensure_on_bed(); #endif // ENABLE_ALLOW_NEGATIVE_Z diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp index 8d7878650b..13512d534b 100644 --- a/src/slic3r/GUI/Selection.cpp +++ b/src/slic3r/GUI/Selection.cpp @@ -12,6 +12,9 @@ #include "Plater.hpp" #include "libslic3r/Model.hpp" +#if DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA +#include "libslic3r/PresetBundle.hpp" +#endif // DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA #include @@ -893,10 +896,11 @@ void Selection::scale(const Vec3d& scale, TransformationType transformation_type else if (m_mode == Volume) synchronize_unselected_volumes(); #endif // !DISABLE_INSTANCES_SYNCH - -#if !ENABLE_ALLOW_NEGATIVE_Z - ensure_on_bed(); -#endif // !ENABLE_ALLOW_NEGATIVE_Z + +#if DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA + if (wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA) + ensure_on_bed(); +#endif // DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA this->set_bounding_boxes_dirty(); } @@ -2059,7 +2063,10 @@ void Selection::synchronize_unselected_instances(SyncRotationType sync_rotation_ // z only rotation -> synch instance z // The X,Y rotations should be synchronized from start to end of the rotation. assert(is_rotation_xy_synchronized(rotation, v->get_instance_rotation())); - v->set_instance_offset(Z, volume->get_instance_offset().z()); +#if DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA + if (wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() != ptSLA) +#endif // DISABLE_ALLOW_NEGATIVE_Z_FOR_SLA + v->set_instance_offset(Z, volume->get_instance_offset().z()); break; #else // z only rotation -> keep instance z