diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index f243bb3..5372a82 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3251,7 +3251,9 @@ std::string GCodeGenerator::_extrude( { std::string gcode; const std::string_view description_bridge = path_attr.role.is_bridge() ? " (bridge)"sv : ""sv; - + //w30 + bool is_first_or_bottom_layer = (path_attr.role == ExtrusionRole::TopSolidInfill) || (this->on_first_layer()); + bool is_first = this->on_first_layer(); const bool has_active_instance{m_label_objects.has_active_instance()}; if (m_writer.multiple_extruders && has_active_instance) { gcode += m_label_objects.maybe_change_instance(m_writer); @@ -3332,6 +3334,13 @@ std::string GCodeGenerator::_extrude( // calculate extrusion length per distance unit double e_per_mm = m_writer.extruder()->e_per_mm3() * path_attr.mm3_per_mm; + //w30 + if (is_first_or_bottom_layer) { + if (is_first) + e_per_mm *= m_config.bottom_solid_infill_flow_ratio ; + else + e_per_mm *= m_config.top_solid_infill_flow_ratio ; + } if (m_writer.extrusion_axis().empty()) // gcfNoExtrusion e_per_mm = 0; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 1e5ce3a..3b7059c 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -491,6 +491,8 @@ static std::vector s_Preset_print_options { ,"precise_z_height" //w28 ,"max_bridge_length" + //w30 + ,"top_solid_infill_flow_ratio", "bottom_solid_infill_flow_ratio" }; static std::vector s_Preset_filament_options { diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index ac044d5..856ebee 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -600,6 +600,26 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(1)); + //w30 + def = this->add("top_solid_infill_flow_ratio", coFloat); + def->label = L("Top surface flow ratio"); + def->category = L("Advanced"); + def->tooltip = L("This factor affects the amount of material for top solid infill. " + "You can decrease it slightly to have smooth surface finish"); + def->min = 0; + def->max = 2; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(1)); + + def = this->add("bottom_solid_infill_flow_ratio", coFloat); + def->label = L("Bottom surface flow ratio"); + def->category = L("Advanced"); + def->tooltip = L("This factor affects the amount of material for bottom solid infill"); + def->min = 0; + def->max = 2; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(1)); + def = this->add("bridge_speed", coFloat); def->label = L("Bridges"); def->category = L("Speed"); @@ -5064,6 +5084,12 @@ std::string validate(const FullPrintConfig &cfg) if (cfg.bridge_flow_ratio <= 0) return "Invalid value for --bridge-flow-ratio"; + //w30 + if (cfg.top_solid_infill_flow_ratio <= 0) + return "Invalid value for --top-solid-infill-flow-ratio"; + if (cfg.bottom_solid_infill_flow_ratio <= 0) + return "Invalid value for --bottom-solid-infill-flow-ratio"; + // extruder clearance if (cfg.extruder_clearance_radius <= 0) return "Invalid value for --extruder-clearance-radius"; diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index fe73c86..3647f64 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -668,6 +668,9 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloat, top_solid_min_thickness)) ((ConfigOptionFloatOrPercent, top_solid_infill_speed)) ((ConfigOptionBool, wipe_into_infill)) + //w30 + ((ConfigOptionFloat, top_solid_infill_flow_ratio)) + ((ConfigOptionFloat, bottom_solid_infill_flow_ratio)) ) PRINT_CONFIG_CLASS_DEFINE( diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 1ee45b7..7e5f7be 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1681,6 +1681,9 @@ void TabPrint::build() optgroup = page->new_optgroup(L("Flow")); optgroup->append_single_option_line("bridge_flow_ratio"); + //w30 + optgroup->append_single_option_line("top_solid_infill_flow_ratio"); + optgroup->append_single_option_line("bottom_solid_infill_flow_ratio"); optgroup = page->new_optgroup(L("Slicing")); optgroup->append_single_option_line("slice_closing_radius");