diff --git a/resources/models/mk3_bed.stl b/resources/models/mk3_bed.stl index cfa6d8c6d..1bd1a8faa 100644 Binary files a/resources/models/mk3_bed.stl and b/resources/models/mk3_bed.stl differ diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index cb88027ba..1efbe2209 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2527,6 +2527,22 @@ void PrintConfigDef::init_sla_params() def->min = 0; def->default_value = new ConfigOptionFloat(1.0); + def = this->add("support_pillar_connection_mode", coEnum); + def->label = L("Support pillar connection mode"); + def->tooltip = L("Controls the bridge type between two neigboring pillars." + " Can be zig-zag, cross (double zig-zag) or dynamic which" + " will automatically switch between the first two depending" + " on the distance of the two pillars."); + def->cli = ""; + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values.push_back("zigzag"); + def->enum_values.push_back("cross"); + def->enum_values.push_back("dynamic"); + def->enum_labels.push_back(L("Zig-Zag")); + def->enum_labels.push_back(L("Cross")); + def->enum_labels.push_back(L("Dynamic")); + def->default_value = new ConfigOptionEnum(slapcmDynamic); + def = this->add("support_pillar_widening_factor", coFloat); def->label = L("Pillar widening factor"); def->category = L("Supports"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 4e12114df..4842156d6 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -61,6 +61,12 @@ enum SLADisplayOrientation { sladoPortrait }; +enum SLAPillarConnectionMode { + slapcmZigZag, + slapcmCross, + slapcmDynamic +}; + template<> inline const t_config_enum_values& ConfigOptionEnum::get_enum_values() { static t_config_enum_values keys_map; if (keys_map.empty()) { @@ -162,6 +168,16 @@ template<> inline const t_config_enum_values& ConfigOptionEnum inline const t_config_enum_values& ConfigOptionEnum::get_enum_values() { + static const t_config_enum_values keys_map = { + {"zigzag", slapcmZigZag}, + {"cross", slapcmCross}, + {"dynamic", slapcmDynamic} + }; + + return keys_map; +} + // Defines each and every confiuration option of Slic3r, including the properties of the GUI dialogs. // Does not store the actual values, but defines default values. class PrintConfigDef : public ConfigDef @@ -949,6 +965,9 @@ public: // Radius in mm of the support pillars. ConfigOptionFloat support_pillar_diameter /*= 0.8*/; + // How the pillars are bridged together + ConfigOptionEnum support_pillar_connection_mode; + // TODO: unimplemented at the moment. This coefficient will have an impact // when bridges and pillars are merged. The resulting pillar should be a bit // thicker than the ones merging into it. How much thicker? I don't know @@ -1003,6 +1022,7 @@ protected: OPT_PTR(support_head_penetration); OPT_PTR(support_head_width); OPT_PTR(support_pillar_diameter); + OPT_PTR(support_pillar_connection_mode); OPT_PTR(support_pillar_widening_factor); OPT_PTR(support_base_diameter); OPT_PTR(support_base_height); diff --git a/src/libslic3r/SLA/SLASupportTree.cpp b/src/libslic3r/SLA/SLASupportTree.cpp index 5239255b1..bc02d2b58 100644 --- a/src/libslic3r/SLA/SLASupportTree.cpp +++ b/src/libslic3r/SLA/SLASupportTree.cpp @@ -1249,8 +1249,13 @@ bool SLASupportTree::generate(const PointSet &points, if(chkd >= bridge_distance) { result.add_bridge(sj, ej, pillar.r); + auto pcm = cfg.pillar_connection_mode; + // double bridging: (crosses) - if(pillar_dist > 2*cfg.base_radius_mm) { + if( pcm == PillarConnectionMode::cross || + (pcm == PillarConnectionMode::dynamic && + pillar_dist > 2*cfg.base_radius_mm)) + { // If the columns are close together, no need to // double bridge them Vec3d bsj(ej(X), ej(Y), sj(Z)); diff --git a/src/libslic3r/SLA/SLASupportTree.hpp b/src/libslic3r/SLA/SLASupportTree.hpp index c187cf5b3..5a86d4623 100644 --- a/src/libslic3r/SLA/SLASupportTree.hpp +++ b/src/libslic3r/SLA/SLASupportTree.hpp @@ -28,6 +28,12 @@ using SlicedSupports = std::vector; namespace sla { +enum class PillarConnectionMode { + zigzag, + cross, + dynamic +}; + struct SupportConfig { // Radius in mm of the pointing side of the head. double head_front_radius_mm = 0.2; @@ -46,6 +52,9 @@ struct SupportConfig { // headless pillars will have half of this value. double headless_pillar_radius_mm = 0.4; + // How to connect pillars + PillarConnectionMode pillar_connection_mode = PillarConnectionMode::dynamic; + // TODO: unimplemented at the moment. This coefficient will have an impact // when bridges and pillars are merged. The resulting pillar should be a bit // thicker than the ones merging into it. How much thicker? I don't know diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index aa759a47a..5cddadb5b 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -407,6 +407,14 @@ sla::SupportConfig make_support_cfg(const SLAPrintObjectConfig& c) { scfg.tilt = c.support_critical_angle.getFloat() * PI / 180.0 ; scfg.max_bridge_length_mm = c.support_max_bridge_length.getFloat(); scfg.headless_pillar_radius_mm = 0.375*c.support_pillar_diameter.getFloat(); + switch(c.support_pillar_connection_mode.getInt()) { + case slapcmZigZag: + scfg.pillar_connection_mode = sla::PillarConnectionMode::zigzag; break; + case slapcmCross: + scfg.pillar_connection_mode = sla::PillarConnectionMode::cross; break; + case slapcmDynamic: + scfg.pillar_connection_mode = sla::PillarConnectionMode::dynamic; break; + } scfg.pillar_widening_factor = c.support_pillar_widening_factor.getFloat(); scfg.base_radius_mm = 0.5*c.support_base_diameter.getFloat(); scfg.base_height_mm = c.support_base_height.getFloat(); @@ -1058,6 +1066,7 @@ bool SLAPrintObject::invalidate_state_by_config_options(const std::vector(ret_enum); else if (m_opt_id.compare("display_orientation") == 0) m_value = static_cast(ret_enum); + else if (m_opt_id.compare("support_pillar_connection_mode") == 0) + m_value = static_cast(ret_enum); } else if (m_opt.gui_type == "f_enum_open") { const int ret_enum = static_cast(window)->GetSelection(); diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index 0a27af9fa..6cdb2ab7e 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -200,6 +200,8 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt config.set_key_value(opt_key, new ConfigOptionEnum(boost::any_cast(value))); else if (opt_key.compare("display_orientation") == 0) config.set_key_value(opt_key, new ConfigOptionEnum(boost::any_cast(value))); + else if(opt_key.compare("support_pillar_connection_mode") == 0) + config.set_key_value(opt_key, new ConfigOptionEnum(boost::any_cast(value))); } break; case coPoints:{ diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index bf7b3ed58..72c6f676b 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -557,6 +557,9 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config else if (opt_key.compare("display_orientation") == 0) { ret = static_cast(config.option>(opt_key)->value); } + else if (opt_key.compare("support_pillar_connection_mode") == 0) { + ret = static_cast(config.option>(opt_key)->value); + } } break; case coPoints: diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index 14ddaad49..102b0610e 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -410,6 +410,7 @@ const std::vector& Preset::sla_print_options() "support_head_penetration", "support_head_width", "support_pillar_diameter", + "support_pillar_connection_mode", "support_pillar_widening_factor", "support_base_diameter", "support_base_height", diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 4601d05d3..22aed5cf9 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3153,6 +3153,7 @@ void TabSLAPrint::build() optgroup = page->new_optgroup(_(L("Support pillar"))); optgroup->append_single_option_line("support_pillar_diameter"); + optgroup->append_single_option_line("support_pillar_connection_mode"); optgroup->append_single_option_line("support_pillar_widening_factor"); optgroup->append_single_option_line("support_base_diameter"); optgroup->append_single_option_line("support_base_height");