diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 673424d07b..9c6da1ad02 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -683,7 +683,9 @@ static std::vector s_Preset_print_options { "gcode_add_line_number", "enable_arc_fitting", "infill_combination", "adaptive_layer_height", "support_bottom_interface_spacing", "enable_overhang_speed", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed", "initial_layer_infill_speed", "only_one_wall_top", "only_one_wall_first_layer", - "timelapse_type" + "timelapse_type", + //SoftFever + "top_solid_infill_flow_ratio" }; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 351ec130d3..118d2d7a60 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -640,6 +640,16 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(1)); + 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("only_one_wall_top", coBool); def->label = L("Only one wall on top surfaces"); def->category = L("Quality"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 0d626aea12..e556d6511d 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -654,6 +654,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloat, bridge_flow)) ((ConfigOptionFloat, bridge_speed)) ((ConfigOptionEnum, top_surface_pattern)) + ((ConfigOptionFloat, top_solid_infill_flow_ratio)) ((ConfigOptionEnum, bottom_surface_pattern)) ((ConfigOptionFloat, outer_wall_line_width)) ((ConfigOptionFloat, outer_wall_speed)) diff --git a/src/libslic3r/PrintRegion.cpp b/src/libslic3r/PrintRegion.cpp index 0f9f92e488..7ed45fb444 100644 --- a/src/libslic3r/PrintRegion.cpp +++ b/src/libslic3r/PrintRegion.cpp @@ -22,6 +22,7 @@ Flow PrintRegion::flow(const PrintObject &object, FlowRole role, double layer_he { const PrintConfig &print_config = object.print()->config(); ConfigOptionFloat config_width; + double flow_ratio = 1.0; // Get extrusion width from configuration. // (might be an absolute value, or a percent value, or zero for auto) if (first_layer && print_config.initial_layer_line_width.value > 0) { @@ -36,6 +37,7 @@ Flow PrintRegion::flow(const PrintObject &object, FlowRole role, double layer_he config_width = m_config.internal_solid_infill_line_width; } else if (role == frTopSolidInfill) { config_width = m_config.top_surface_line_width; + flow_ratio = m_config.top_solid_infill_flow_ratio; } else { throw Slic3r::InvalidArgument("Unknown role"); } @@ -46,7 +48,7 @@ Flow PrintRegion::flow(const PrintObject &object, FlowRole role, double layer_he // Get the configured nozzle_diameter for the extruder associated to the flow role requested. // Here this->extruder(role) - 1 may underflow to MAX_INT, but then the get_at() will follback to zero'th element, so everything is all right. auto nozzle_diameter = float(print_config.nozzle_diameter.get_at(this->extruder(role) - 1)); - return Flow::new_from_config_width(role, config_width, nozzle_diameter, float(layer_height)); + return Flow::new_from_config_width(role, config_width, nozzle_diameter, float(layer_height)).with_flow_ratio(flow_ratio); } coordf_t PrintRegion::nozzle_dmr_avg(const PrintConfig &print_config) const diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index e09239c29b..4bd10b75da 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1782,6 +1782,7 @@ void TabPrint::build() optgroup = page->new_optgroup(L("Advanced")); optgroup->append_single_option_line("wall_infill_order"); optgroup->append_single_option_line("bridge_flow"); + optgroup->append_single_option_line("top_solid_infill_flow_ratio"); optgroup->append_single_option_line("only_one_wall_top"); optgroup->append_single_option_line("only_one_wall_first_layer"); optgroup->append_single_option_line("detect_overhang_wall");