From c3e1be7531e271c9a7ed82cffc83454c79f6a01f Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Tue, 5 Feb 2019 11:16:03 +0100 Subject: [PATCH] Added parameter "support_buildplate_only" for SLA supports. --- src/libslic3r/PrintConfig.cpp | 8 ++++++++ src/libslic3r/PrintConfig.hpp | 4 ++++ src/libslic3r/SLA/SLASupportTree.cpp | 11 +++++++++++ src/libslic3r/SLA/SLASupportTree.hpp | 3 +++ src/libslic3r/SLAPrint.cpp | 2 ++ src/slic3r/GUI/Preset.cpp | 1 + src/slic3r/GUI/Tab.cpp | 1 + 7 files changed, 30 insertions(+) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index e716710215..3e1ee9f9f8 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2566,6 +2566,14 @@ void PrintConfigDef::init_sla_params() def->enum_labels.push_back(L("Dynamic")); def->default_value = new ConfigOptionEnum(slapcmDynamic); + def = this->add("support_buildplate_only", coBool); + def->label = L("Support on build plate only"); + def->category = L("Supports"); + def->tooltip = L("Only create support if it lies on a build plate. Don't create support on a print."); + def->cli = "support-buildplate-only!"; + def->mode = comSimple; + def->default_value = new ConfigOptionBool(false); + 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 6b9e68eeff..20c089d1c0 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -976,6 +976,9 @@ public: // How the pillars are bridged together ConfigOptionEnum support_pillar_connection_mode; + // Generate only ground facing supports + ConfigOptionBool support_buildplate_only; + // 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 @@ -1031,6 +1034,7 @@ protected: OPT_PTR(support_head_width); OPT_PTR(support_pillar_diameter); OPT_PTR(support_pillar_connection_mode); + OPT_PTR(support_buildplate_only); 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 54e3a0189b..5a51870931 100644 --- a/src/libslic3r/SLA/SLASupportTree.cpp +++ b/src/libslic3r/SLA/SLASupportTree.cpp @@ -1898,6 +1898,17 @@ bool SLASupportTree::generate(const PointSet &points, } }; + if(cfg.ground_facing_only) { // Delete the non-gnd steps if necessary + program[ROUTING_NONGROUND] = []() { + BOOST_LOG_TRIVIAL(info) << "Skipping non-ground facing supports as " + "requested."; + }; + program[HEADLESS] = [](){ + BOOST_LOG_TRIVIAL(info) << "Skipping headless stick generation as " + "requested"; + }; + } + Steps pc = BEGIN, pc_prev = BEGIN; // Let's define a simple automaton that will run our program. diff --git a/src/libslic3r/SLA/SLASupportTree.hpp b/src/libslic3r/SLA/SLASupportTree.hpp index 8de8d2b337..7d23a981fb 100644 --- a/src/libslic3r/SLA/SLASupportTree.hpp +++ b/src/libslic3r/SLA/SLASupportTree.hpp @@ -55,6 +55,9 @@ struct SupportConfig { // How to connect pillars PillarConnectionMode pillar_connection_mode = PillarConnectionMode::dynamic; + // Only generate pillars that can be routed to ground + bool ground_facing_only = false; + // 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 3cc6895589..7da47fae76 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -415,6 +415,7 @@ sla::SupportConfig make_support_cfg(const SLAPrintObjectConfig& c) { case slapcmDynamic: scfg.pillar_connection_mode = sla::PillarConnectionMode::dynamic; break; } + scfg.ground_facing_only = c.support_buildplate_only.getBool(); 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(); @@ -1063,6 +1064,7 @@ bool SLAPrintObject::invalidate_state_by_config_options(const std::vector& Preset::sla_print_options() "support_head_width", "support_pillar_diameter", "support_pillar_connection_mode", + "support_buildplate_only", "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 69b3c5b308..28b7cd248d 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3191,6 +3191,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_buildplate_only"); 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");