diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index ce9536d708..528a72e708 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -11,7 +11,6 @@ #include "Support/SupportMaterial.hpp" #include "Support/SupportSpotsGenerator.hpp" #include "Support/TreeSupport.hpp" -#include "Support/TreeSupport3D.hpp" #include "Surface.hpp" #include "Slicing.hpp" #include "Tesselate.hpp" @@ -3521,18 +3520,14 @@ void PrintObject::combine_infill() void PrintObject::_generate_support_material() { - PrintObjectSupportMaterial support_material(this, m_slicing_params); - support_material.generate(*this); - - if (this->config().enable_support.value && is_tree(this->config().support_type.value)) { - if (this->config().support_style.value == smsOrganic || - // Orca: use organic as default - this->config().support_style.value == smsDefault) { - generate_tree_support_3D(*this, std::function([this]() { this->throw_if_canceled(); })); - } else { - TreeSupport tree_support(*this, m_slicing_params); - tree_support.generate(); - } + if (is_tree(m_config.support_type.value)) { + TreeSupport tree_support(*this, m_slicing_params); + tree_support.throw_on_cancel = [this]() { this->throw_if_canceled(); }; + tree_support.generate(); + } + else { + PrintObjectSupportMaterial support_material(this, m_slicing_params); + support_material.generate(*this); } } diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index dc4f9998ff..a0440bfcaf 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -11,6 +11,7 @@ #include "ShortestPath.hpp" #include "I18N.hpp" #include +#include "TreeSupport3D.hpp" #include #include @@ -672,14 +673,15 @@ TreeSupport::TreeSupport(PrintObject& object, const SlicingParameters &slicing_p support_type = m_object_config->support_type; support_style = m_object_config->support_style; if (support_style == smsDefault) - support_style = smsTreeHybrid; + // Orca: use organic as default + support_style = smsOrganic; SupportMaterialPattern support_pattern = m_object_config->support_base_pattern; - if (support_style == smsTreeHybrid && support_pattern == smpDefault) support_pattern = smpRectilinear; - m_support_params.base_fill_pattern = + if (support_style == smsTreeHybrid && support_pattern == smpDefault) + support_pattern = smpRectilinear; + m_support_params.base_fill_pattern = support_pattern == smpLightning ? ipLightning : support_pattern == smpHoneycomb ? ipHoneycomb : - m_support_params.support_density > 0.95 || m_support_params.with_sheath ? ipRectilinear : - ipSupportBase; + m_support_params.support_density > 0.95 || m_support_params.with_sheath ? ipRectilinear : ipSupportBase; m_support_params.interface_fill_pattern = (m_support_params.interface_density > 0.95 ? ipRectilinear : ipSupportBase); if (m_object_config->support_interface_pattern == smipGrid) @@ -1879,9 +1881,10 @@ Polygons TreeSupport::contact_nodes_to_polygon(const std::vector& contact void TreeSupport::generate() { - bool tree_support_enable = m_object_config->enable_support.value && is_tree(m_object_config->support_type.value); - if (!tree_support_enable) + if (support_style == smsOrganic) { + generate_tree_support_3D(*m_object, this->throw_on_cancel); return; + } std::vector> contact_nodes(m_object->layers().size()); diff --git a/src/libslic3r/Support/TreeSupport.hpp b/src/libslic3r/Support/TreeSupport.hpp index 2f3546ed23..17e146ddcd 100644 --- a/src/libslic3r/Support/TreeSupport.hpp +++ b/src/libslic3r/Support/TreeSupport.hpp @@ -401,6 +401,8 @@ public: std::unique_ptr generator; std::unordered_map printZ_to_lightninglayer; + + std::function throw_on_cancel; private: /*! * \brief Generator for model collision, avoidance and internal guide volumes