diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 6b691681d..4c10a44fa 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -1119,6 +1119,10 @@ TriangleMesh SLAPrintObject::get_mesh(SLAPrintObjectStep step) const return this->support_mesh(); case slaposPad: return this->pad_mesh(); + case slaposHollowing: + if (m_hollowing_data) + return m_hollowing_data->hollow_mesh_with_holes; + [[fallthrough]]; default: return TriangleMesh(); } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp index d02fdd077..042298274 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp @@ -608,10 +608,14 @@ void GLGizmoHollow::update_mesh_raycaster(std::unique_ptr<MeshRaycaster> &&rc) m_c->m_volume_with_cavity.reset(); } -void GLGizmoHollow::hollow_mesh() +void GLGizmoHollow::hollow_mesh(bool postpone_error_messages) { // Trigger a UI job to hollow the mesh. - wxGetApp().plater()->hollow(); + // wxGetApp().plater()->hollow(); + + wxGetApp().CallAfter([this, postpone_error_messages]() { + wxGetApp().plater()->reslice_SLA_hollowing(*m_c->m_model_object, postpone_error_messages); + }); } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.hpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.hpp index f6560c861..79b0a6929 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.hpp @@ -55,7 +55,7 @@ private: void render_hollowed_mesh() const; bool is_mesh_update_necessary() const; void update_mesh(); - void hollow_mesh(); + void hollow_mesh(bool postpone_error_messages = false); bool unsaved_changes() const; bool m_show_supports = true; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6d869baaa..37ea24a16 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -5099,6 +5099,16 @@ void Plater::reslice() } void Plater::reslice_SLA_supports(const ModelObject &object, bool postpone_error_messages) +{ + reslice_SLA_until_step(slaposPad, object, postpone_error_messages); +} + +void Plater::reslice_SLA_hollowing(const ModelObject &object, bool postpone_error_messages) +{ + reslice_SLA_until_step(slaposHollowing, object, postpone_error_messages); +} + +void Plater::reslice_SLA_until_step(SLAPrintObjectStep step, const ModelObject &object, bool postpone_error_messages) { //FIXME Don't reslice if export of G-code or sending to OctoPrint is running. // bitmask of UpdateBackgroundProcessReturnState @@ -5117,7 +5127,7 @@ void Plater::reslice_SLA_supports(const ModelObject &object, bool postpone_error // Otherwise calculate everything, but start with the provided object. if (!this->p->background_processing_enabled()) { task.single_model_instance_only = true; - task.to_object_step = slaposPad; + task.to_object_step = step; } this->p->background_process.set_task(task); // and let the background processing start. diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index c03813a9c..9639a1693 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -26,6 +26,7 @@ class Model; class ModelObject; class Print; class SLAPrint; +enum SLAPrintObjectStep : unsigned int; namespace UndoRedo { class Stack; @@ -197,6 +198,8 @@ public: void hollow(); void reslice(); void reslice_SLA_supports(const ModelObject &object, bool postpone_error_messages = false); + void reslice_SLA_hollowing(const ModelObject &object, bool postpone_error_messages = false); + void reslice_SLA_until_step(SLAPrintObjectStep step, const ModelObject &object, bool postpone_error_messages = false); void changed_object(int obj_idx); void changed_objects(const std::vector<size_t>& object_idxs); void schedule_background_process(bool schedule = true);