From 7f4c9c9a5c322f3494fa98a5614f578f684ee063 Mon Sep 17 00:00:00 2001 From: supermerill Date: Wed, 18 Mar 2020 21:01:18 +0100 Subject: [PATCH] add "first layer flow" setting, for fuck sake first layer width isn't enough with a cheap printer like an ender3 that can have his bed damaged so easily. --- resources/ui_layout/print.ui | 1 + src/libslic3r/GCode.cpp | 1 + src/libslic3r/Print.cpp | 1 + src/libslic3r/PrintConfig.cpp | 11 ++++++++++- src/libslic3r/PrintConfig.hpp | 2 ++ src/slic3r/GUI/Preset.cpp | 1 + src/slic3r/GUI/Tab.cpp | 1 + 7 files changed, 17 insertions(+), 1 deletion(-) diff --git a/resources/ui_layout/print.ui b/resources/ui_layout/print.ui index 820d20527..b9526f966 100644 --- a/resources/ui_layout/print.ui +++ b/resources/ui_layout/print.ui @@ -216,6 +216,7 @@ group:Flow setting:bridge_flow_ratio setting:over_bridge_flow_ratio setting:fill_top_flow_ratio + setting:first_layer_flow_ratio end_line page:Multiple extruders:funnel diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 575cb42d8..25e19bfe2 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3350,6 +3350,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string &descri // calculate extrusion length per distance unit double e_per_mm = m_writer.extruder()->e_per_mm3() * path.mm3_per_mm; + if (this->m_layer_index <= 0) e_per_mm *= this->config().first_layer_flow_ratio.get_abs_value(1); if (m_writer.extrusion_axis().empty()) e_per_mm = 0; double path_length = 0.; { diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index e095ad989..1d6f95281 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -102,6 +102,7 @@ bool Print::invalidate_state_by_config_options(const std::vectorlabel = L("Top fill"); def->full_label = L("Top fill flow ratio"); def->category = OptionCategory::width; - def->tooltip = L("You can increase this to over-extrude on the top layer if there are not enough plastic to makle a good fill."); + def->tooltip = L("You can increase this to over-extrude on the top layer if there are not enough plastic to make a good fill."); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); + + def = this->add("first_layer_flow_ratio", coFloatOrPercent); + def->label = L("First layer"); + def->full_label = L("First layer flow ratio"); + def->category = OptionCategory::width; + def->tooltip = L("You can increase this to over-extrude on the first layer if there are not enough plastic because your bed isn't levelled."); def->min = 0; def->mode = comExpert; def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index d7fd91f98..2db644bc0 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1007,6 +1007,7 @@ public: ConfigOptionFloat first_layer_acceleration; ConfigOptionInts first_layer_bed_temperature; ConfigOptionFloatOrPercent first_layer_extrusion_width; + ConfigOptionFloatOrPercent first_layer_flow_ratio; ConfigOptionFloatOrPercent first_layer_speed; ConfigOptionFloatOrPercent first_layer_infill_speed; ConfigOptionInts first_layer_temperature; @@ -1085,6 +1086,7 @@ protected: OPT_PTR(first_layer_acceleration); OPT_PTR(first_layer_bed_temperature); OPT_PTR(first_layer_extrusion_width); + OPT_PTR(first_layer_flow_ratio); OPT_PTR(first_layer_speed); OPT_PTR(first_layer_infill_speed); OPT_PTR(first_layer_temperature); diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index 68533b774..67a4ef7ba 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -452,6 +452,7 @@ const std::vector& Preset::print_options() "clip_multipart_objects", "over_bridge_flow_ratio", "bridge_overlap", + "first_layer_flow_ratio", "clip_multipart_objects", "enforce_full_fill_volume", "external_infill_margin", "bridged_infill_margin", "elefant_foot_compensation", "xy_size_compensation", "hole_size_compensation", "hole_to_polyhole", diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 57e8c3051..d49e61891 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1746,6 +1746,7 @@ void TabPrint::build() line.append_option(optgroup->get_option("bridge_overlap")); line.append_option(optgroup->get_option("over_bridge_flow_ratio")); line.append_option(optgroup->get_option("fill_top_flow_ratio")); + line.append_option(optgroup->get_option("first_layer_flow_ratio")); optgroup->append_line(line); page = add_options_page(_(L(toString(OptionCategory::extruders))), "funnel");