Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortamasmeszaros <meszaros.q@gmail.com>2019-01-09 14:21:43 +0300
committertamasmeszaros <meszaros.q@gmail.com>2019-01-09 14:21:43 +0300
commit1947925263f7107916af4970fc3de769fe7bcb6f (patch)
tree4f5d15da13d895d5c6b3064a81754e19c693969b
parent41d189a3558ac44c9247868616924bf69d1b9290 (diff)
Added parameter for pillar connection mode
-rw-r--r--src/libslic3r/PrintConfig.cpp16
-rw-r--r--src/libslic3r/PrintConfig.hpp20
-rw-r--r--src/libslic3r/SLA/SLASupportTree.cpp7
-rw-r--r--src/libslic3r/SLA/SLASupportTree.hpp9
-rw-r--r--src/libslic3r/SLAPrint.cpp9
-rw-r--r--src/slic3r/GUI/Field.cpp2
-rw-r--r--src/slic3r/GUI/GUI.cpp2
-rw-r--r--src/slic3r/GUI/OptionsGroup.cpp3
-rw-r--r--src/slic3r/GUI/Preset.cpp1
-rw-r--r--src/slic3r/GUI/Tab.cpp1
10 files changed, 69 insertions, 1 deletions
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<SLAPillarConnectionMode>::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<SLAPillarConnectionMode>(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<PrinterTechnology>::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<SLADisplayOrienta
return keys_map;
}
+template<> inline const t_config_enum_values& ConfigOptionEnum<SLAPillarConnectionMode>::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<SLAPillarConnectionMode> 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<SliceLayer>;
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<t_conf
|| opt_key == "support_head_penetration"
|| opt_key == "support_head_width"
|| opt_key == "support_pillar_diameter"
+ || opt_key == "support_pillar_connection_mode"
|| opt_key == "support_base_diameter"
|| opt_key == "support_base_height"
|| opt_key == "support_critical_angle"
diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp
index e64bf3d5f..817de5d4f 100644
--- a/src/slic3r/GUI/Field.cpp
+++ b/src/slic3r/GUI/Field.cpp
@@ -718,6 +718,8 @@ boost::any& Choice::get_value()
m_value = static_cast<PrintHostType>(ret_enum);
else if (m_opt_id.compare("display_orientation") == 0)
m_value = static_cast<SLADisplayOrientation>(ret_enum);
+ else if (m_opt_id.compare("support_pillar_connection_mode") == 0)
+ m_value = static_cast<SLAPillarConnectionMode>(ret_enum);
}
else if (m_opt.gui_type == "f_enum_open") {
const int ret_enum = static_cast<wxComboBox*>(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<PrintHostType>(boost::any_cast<PrintHostType>(value)));
else if (opt_key.compare("display_orientation") == 0)
config.set_key_value(opt_key, new ConfigOptionEnum<SLADisplayOrientation>(boost::any_cast<SLADisplayOrientation>(value)));
+ else if(opt_key.compare("support_pillar_connection_mode") == 0)
+ config.set_key_value(opt_key, new ConfigOptionEnum<SLAPillarConnectionMode>(boost::any_cast<SLAPillarConnectionMode>(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<int>(config.option<ConfigOptionEnum<SLADisplayOrientation>>(opt_key)->value);
}
+ else if (opt_key.compare("support_pillar_connection_mode") == 0) {
+ ret = static_cast<int>(config.option<ConfigOptionEnum<SLAPillarConnectionMode>>(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<std::string>& 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");