From 9e9f00f97d08cd1143e6b84a3c89c4cf4fb8e8aa Mon Sep 17 00:00:00 2001 From: supermerill Date: Sat, 23 Dec 2023 12:22:35 +0100 Subject: [PATCH 1/6] fix to_prusa conversion: support_material_extrusion_width --- src/libslic3r/PrintConfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index a81ec9343d2..22eb705b34f 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -8123,7 +8123,7 @@ std::map PrintConfigDef::to_prusa(t_config_option_key& value = "octoprint"; } else if (opt_key.find("extrusion_width") != std::string::npos) { if (std::set{"extrusion_width", "first_layer_extrusion_width", "perimeter_extrusion_width", "external_perimeter_extrusion_width", - "infill_extrusion_width", "solid_infill_extrusion_width", "top_infill_extrusion_width"}.count(opt_key) > 0) { + "infill_extrusion_width", "solid_infill_extrusion_width", "top_infill_extrusion_width", "support_material_extrusion_width"}.count(opt_key) > 0) { const ConfigOptionFloatOrPercent* opt = all_conf.option(opt_key); if (opt->is_phony() || opt->percent) { if (opt->percent) { From 766bb03d02512f5592320028a565e116d27c3c4f Mon Sep 17 00:00:00 2001 From: supermerill Date: Sat, 23 Dec 2023 12:23:28 +0100 Subject: [PATCH 2/6] fix snug support with 0 bottom interface layers supermerill/SuperSlicer#4012 --- src/libslic3r/SupportMaterial.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libslic3r/SupportMaterial.cpp b/src/libslic3r/SupportMaterial.cpp index 43e07402fdf..ee19d2753e1 100644 --- a/src/libslic3r/SupportMaterial.cpp +++ b/src/libslic3r/SupportMaterial.cpp @@ -4285,7 +4285,6 @@ void PrintObjectSupportMaterial::generate_toolpaths( size_t idx_layer_intermediate = size_t(-1); size_t idx_layer_interface = size_t(-1); size_t idx_layer_base_interface = size_t(-1); - const InfillPattern fill_type_first_layer = ipRectiWithPerimeter; std::unique_ptr filler_interface = std::unique_ptr(Fill::new_from_type(m_support_params.contact_fill_pattern)); std::unique_ptr filler_intermediate_interface = std::unique_ptr(Fill::new_from_type(ipRectilinear)); // Filler for the base interface (to be used for soluble interface / non soluble base, to produce non soluble interface layer below soluble interface layer). @@ -4406,7 +4405,7 @@ void PrintObjectSupportMaterial::generate_toolpaths( float supp_density = m_support_params.interface_density; coordf_t filler_spacing; //if first layer and solid first layer : draw concentric with 100% density - if (support_layer.id() == 0) { + if (support_layer.id() == 0 && layer_ex.layer->bottom_z <= 0) { filler = filler_first_layer_ptr.get(); supp_density = float(this->m_object_config->raft_first_layer_density.get_abs_value(1.)); interface_flow = m_support_params.first_layer_flow; From c1d9013aa300a8a246243ad735d32ad8a5077b2a Mon Sep 17 00:00:00 2001 From: supermerill Date: Sat, 23 Dec 2023 12:39:52 +0100 Subject: [PATCH 3/6] fix search in setting tabs supermerill/SuperSlicer#4013 --- src/slic3r/GUI/Search.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Search.cpp b/src/slic3r/GUI/Search.cpp index f5cbf41fb31..5b81566ecf8 100644 --- a/src/slic3r/GUI/Search.cpp +++ b/src/slic3r/GUI/Search.cpp @@ -37,6 +37,8 @@ namespace Search { static char marker_by_type(Preset::Type type, PrinterTechnology pt) { switch(type) { + case Preset::TYPE_FREQUENT_FFF: + case Preset::TYPE_FREQUENT_SLA: case Preset::TYPE_FFF_PRINT: case Preset::TYPE_SLA_PRINT: return ImGui::PrintIconMarker; @@ -47,7 +49,7 @@ static char marker_by_type(Preset::Type type, PrinterTechnology pt) case Preset::TYPE_PRINTER: return pt == ptSLA ? ImGui::PrinterSlaIconMarker : ImGui::PrinterIconMarker; default: - return ' '; + return ImGui::PrintIconMarker; } } @@ -994,9 +996,11 @@ void SearchListModel::Clear() void SearchListModel::Prepend(const std::string& label) { const char icon_c = label.at(0); - int icon_idx = icon_idxs.at(icon_c); - wxString str = from_u8(label).Remove(0, 1); + wxString str = from_u8(label).Remove(0, 1); + int icon_idx = 0; + if(icon_c < icon_idxs.size()) + icon_idx = icon_idxs.at(icon_c); m_values.emplace_back(str, icon_idx); RowPrepended(); From 38f0d28318c4193b55ca0da19c287cfc04189530 Mon Sep 17 00:00:00 2001 From: supermerill Date: Sat, 23 Dec 2023 13:39:50 +0100 Subject: [PATCH 4/6] fix preview for brim_per_object without complete_objects /supermerill/SuperSlicer#3969 --- src/slic3r/GUI/GLCanvas3D.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 2ba8dc8d53e..8baf229aa04 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -6018,7 +6018,8 @@ void GLCanvas3D::_load_skirt_brim_preview_toolpaths(const BuildVolume &build_vol if (!print_object->brim().empty()) for (const PrintInstance& inst : print_object->instances()) { if (!print_object->brim().empty()) volume = ensure_volume_is_ready(volume); - _3DScene::extrusionentity_to_verts(print_object->brim(), print_zs[i], inst.shift, *volume); + _3DScene::extrusionentity_to_verts(print_object->brim(), print_zs[i], + print->config().complete_objects? inst.shift : Point(0, 0), *volume); } if (print_object->skirt_first_layer()) for (const PrintInstance& inst : print_object->instances()) { @@ -6037,7 +6038,8 @@ void GLCanvas3D::_load_skirt_brim_preview_toolpaths(const BuildVolume &build_vol if ( !print_object->skirt().empty() && (i != 0 || !print_object->skirt_first_layer())) for (const PrintInstance& inst : print_object->instances()) { if (!print_object->skirt().empty()) volume = ensure_volume_is_ready(volume); - _3DScene::extrusionentity_to_verts(print_object->skirt(), print_zs[i], inst.shift, *volume); + _3DScene::extrusionentity_to_verts(print_object->skirt(), print_zs[i], + print->config().complete_objects? inst.shift : Point(0, 0), *volume); } } } From b672a1a4eb8093126338fdb6697d4733be97b54f Mon Sep 17 00:00:00 2001 From: supermerill Date: Sat, 23 Dec 2023 14:21:59 +0100 Subject: [PATCH 5/6] wipe tower use filament_max_speed --- src/libslic3r/GCode/WipeTower.cpp | 6 ++++++ src/libslic3r/GCode/WipeTower.hpp | 1 + 2 files changed, 7 insertions(+) diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 4df3e377d96..03876a97ba7 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -181,6 +181,9 @@ class WipeTowerWriter if (limit_volumetric_flow) { float e_speed = e / (((len == 0.f) ? std::abs(e) : len) / f * 60.f); f /= std::max(1.f, e_speed / m_filpar[m_current_tool].max_e_speed); + if (len > 0 && m_filpar[m_current_tool].max_speed > 0) { + f = std::min(f, m_filpar[m_current_tool].max_speed); + } } gcode += set_format_F(f); } @@ -730,6 +733,9 @@ void WipeTower::set_extruder(size_t idx) float nozzle_diameter = float(m_config->nozzle_diameter.get_at(idx)); m_filpar[idx].nozzle_diameter = nozzle_diameter; // to be used in future with (non-single) multiextruder MM + float max_speed = float(m_config->filament_max_speed.get_at(idx)); + if (max_speed > 0.f) + m_filpar[idx].max_speed = max_speed; float max_vol_speed = float(m_config->filament_max_volumetric_speed.get_at(idx)); if (max_vol_speed!= 0.f) m_filpar[idx].max_e_speed = (max_vol_speed / filament_area()); diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index df89305b569..1c894d3304e 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -243,6 +243,7 @@ class WipeTower // end skinnydip float ramming_line_width_multiplicator = 1.f; float ramming_step_multiplicator = 1.f; + float max_speed = std::numeric_limits::max(); float max_e_speed = std::numeric_limits::max(); std::vector ramming_speed; float nozzle_diameter; From 123f4a3345afb8a8174adb73af953e060710cd11 Mon Sep 17 00:00:00 2001 From: supermerill Date: Sat, 23 Dec 2023 15:19:27 +0100 Subject: [PATCH 6/6] fix config rework for linux build --- src/libslic3r/Config.hpp | 4 +-- src/libslic3r/GCode/SeamPlacer.cpp | 1 - src/slic3r/GUI/Field.cpp | 50 +++++++++++++++++++++--------- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index e4e79328778..3eb8a474347 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -1200,7 +1200,7 @@ class ConfigOptionPercentsTempl : public ConfigOptionFloatsTempl if (&v != &this->values.front()) ss << ","; this->serialize_single_value(ss, v); - if (! (std::isnan(v) || v == NIL_VALUE())) + if (!(std::isnan(v) || v == ConfigOptionFloatsTempl::NIL_VALUE())) ss << "%"; } std::string str = ss.str(); @@ -1214,7 +1214,7 @@ class ConfigOptionPercentsTempl : public ConfigOptionFloatsTempl for (const double v : this->values) { std::ostringstream ss; this->serialize_single_value(ss, v); - if (! (std::isnan(v) || v == NIL_VALUE())) + if (!(std::isnan(v) || v == ConfigOptionFloatsTempl::NIL_VALUE())) ss << "%"; vv.push_back(ss.str()); } diff --git a/src/libslic3r/GCode/SeamPlacer.cpp b/src/libslic3r/GCode/SeamPlacer.cpp index f173823a336..765b60be632 100644 --- a/src/libslic3r/GCode/SeamPlacer.cpp +++ b/src/libslic3r/GCode/SeamPlacer.cpp @@ -24,7 +24,6 @@ #include "libslic3r/Utils.hpp" //#define DEBUG_FILES -#pragma optimize("", off) #ifdef DEBUG_FILES #include #include diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index e8af859eeb3..e86455ad91f 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -385,12 +385,13 @@ std::pair any_to_wxstring(const boost::any &value, const ConfigO }; // first, easy convert-to one-string switch (opt.type) { - case coFloats: + case coFloats: { if (opt_idx < 0) { deserialize(ConfigOptionFloats{}); break; } - case coPercents: + } + case coPercents: { if (opt_idx < 0) { deserialize(ConfigOptionPercents{}); break; @@ -400,23 +401,31 @@ std::pair any_to_wxstring(const boost::any &value, const ConfigO has_nil = true; break; } + } case coFloat: - case coPercent: text_value = double_to_string(boost::any_cast(value), opt.precision); break; - case coStrings: + case coPercent: { + text_value = double_to_string(boost::any_cast(value), opt.precision); + break; + } + case coStrings: { if (opt_idx < 0) { - //custom for strings, as we don't need the serialized form, the normal one with ';' in-between is enough + // custom for strings, as we don't need the serialized form, the normal one with ';' in-between is enough ConfigOptionStrings reader; reader.set_any(value, opt_idx); std::string good_str; for (std::string s : reader.values) good_str += s + ";"; - if(!good_str.empty()) + if (!good_str.empty()) good_str.pop_back(); text_value = good_str; break; } // can't be nullable - case coString: text_value = boost::any_cast(value); break; - case coFloatsOrPercents: + } + case coString: { + text_value = boost::any_cast(value); + break; + } + case coFloatsOrPercents: { if (opt_idx < 0) { deserialize(ConfigOptionFloatsOrPercents{}); break; @@ -427,13 +436,15 @@ std::pair any_to_wxstring(const boost::any &value, const ConfigO has_nil = true; break; } - case coFloatOrPercent: + } + case coFloatOrPercent: { FloatOrPercent fl_or_per = boost::any_cast(value); text_value = double_to_string(fl_or_per.value); if (fl_or_per.percent) text_value.append("%"); break; - case coBools: + } + case coBools: { if (opt_idx < 0) { deserialize(ConfigOptionBools{}); } else { @@ -445,12 +456,14 @@ std::pair any_to_wxstring(const boost::any &value, const ConfigO text_value = boost::any_cast(value) != 0 ? "true" : "false"; } break; - case coBool: + } + case coBool: { if (opt.is_script) text_value = boost::any_cast(value) != 0 ? "true" : "false"; else text_value = boost::any_cast(value) ? "true" : "false"; - case coInts: + } + case coInts: { if (opt_idx < 0) { deserialize(ConfigOptionInts{}); break; @@ -460,14 +473,21 @@ std::pair any_to_wxstring(const boost::any &value, const ConfigO has_nil = true; break; } - case coInt: text_value = wxString::Format(_T("%i"), int(boost::any_cast(value))); break; + } + case coInt: { + text_value = wxString::Format(_T("%i"), int(boost::any_cast(value))); + break; + } case coPoints: if (opt_idx < 0) { deserialize(ConfigOptionPoints{}); assert(text_value == get_points_string(boost::any_cast>(value))); break; } - case coPoint: text_value = get_points_string({boost::any_cast(value)}); + case coPoint: { + text_value = get_points_string({boost::any_cast(value)}); + break; + } } return {text_value, has_nil}; } @@ -2308,6 +2328,8 @@ boost::any &SliderCtrl::get_value() } else if (m_opt.type == coInt) { return m_value = int32_t(m_slider->GetValue() / m_scale); } + assert(false); + return m_value; } } // GUI