mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
add top&bottom infill flow ratio
This commit is contained in:
@@ -3251,7 +3251,9 @@ std::string GCodeGenerator::_extrude(
|
|||||||
{
|
{
|
||||||
std::string gcode;
|
std::string gcode;
|
||||||
const std::string_view description_bridge = path_attr.role.is_bridge() ? " (bridge)"sv : ""sv;
|
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()};
|
const bool has_active_instance{m_label_objects.has_active_instance()};
|
||||||
if (m_writer.multiple_extruders && has_active_instance) {
|
if (m_writer.multiple_extruders && has_active_instance) {
|
||||||
gcode += m_label_objects.maybe_change_instance(m_writer);
|
gcode += m_label_objects.maybe_change_instance(m_writer);
|
||||||
@@ -3332,6 +3334,13 @@ std::string GCodeGenerator::_extrude(
|
|||||||
|
|
||||||
// calculate extrusion length per distance unit
|
// calculate extrusion length per distance unit
|
||||||
double e_per_mm = m_writer.extruder()->e_per_mm3() * path_attr.mm3_per_mm;
|
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())
|
if (m_writer.extrusion_axis().empty())
|
||||||
// gcfNoExtrusion
|
// gcfNoExtrusion
|
||||||
e_per_mm = 0;
|
e_per_mm = 0;
|
||||||
|
|||||||
@@ -491,6 +491,8 @@ static std::vector<std::string> s_Preset_print_options {
|
|||||||
,"precise_z_height"
|
,"precise_z_height"
|
||||||
//w28
|
//w28
|
||||||
,"max_bridge_length"
|
,"max_bridge_length"
|
||||||
|
//w30
|
||||||
|
,"top_solid_infill_flow_ratio", "bottom_solid_infill_flow_ratio"
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::vector<std::string> s_Preset_filament_options {
|
static std::vector<std::string> s_Preset_filament_options {
|
||||||
|
|||||||
@@ -600,6 +600,26 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
def->set_default_value(new ConfigOptionFloat(1));
|
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 = this->add("bridge_speed", coFloat);
|
||||||
def->label = L("Bridges");
|
def->label = L("Bridges");
|
||||||
def->category = L("Speed");
|
def->category = L("Speed");
|
||||||
@@ -5064,6 +5084,12 @@ std::string validate(const FullPrintConfig &cfg)
|
|||||||
if (cfg.bridge_flow_ratio <= 0)
|
if (cfg.bridge_flow_ratio <= 0)
|
||||||
return "Invalid value for --bridge-flow-ratio";
|
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
|
// extruder clearance
|
||||||
if (cfg.extruder_clearance_radius <= 0)
|
if (cfg.extruder_clearance_radius <= 0)
|
||||||
return "Invalid value for --extruder-clearance-radius";
|
return "Invalid value for --extruder-clearance-radius";
|
||||||
|
|||||||
@@ -668,6 +668,9 @@ PRINT_CONFIG_CLASS_DEFINE(
|
|||||||
((ConfigOptionFloat, top_solid_min_thickness))
|
((ConfigOptionFloat, top_solid_min_thickness))
|
||||||
((ConfigOptionFloatOrPercent, top_solid_infill_speed))
|
((ConfigOptionFloatOrPercent, top_solid_infill_speed))
|
||||||
((ConfigOptionBool, wipe_into_infill))
|
((ConfigOptionBool, wipe_into_infill))
|
||||||
|
//w30
|
||||||
|
((ConfigOptionFloat, top_solid_infill_flow_ratio))
|
||||||
|
((ConfigOptionFloat, bottom_solid_infill_flow_ratio))
|
||||||
)
|
)
|
||||||
|
|
||||||
PRINT_CONFIG_CLASS_DEFINE(
|
PRINT_CONFIG_CLASS_DEFINE(
|
||||||
|
|||||||
@@ -1681,6 +1681,9 @@ void TabPrint::build()
|
|||||||
|
|
||||||
optgroup = page->new_optgroup(L("Flow"));
|
optgroup = page->new_optgroup(L("Flow"));
|
||||||
optgroup->append_single_option_line("bridge_flow_ratio");
|
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 = page->new_optgroup(L("Slicing"));
|
||||||
optgroup->append_single_option_line("slice_closing_radius");
|
optgroup->append_single_option_line("slice_closing_radius");
|
||||||
|
|||||||
Reference in New Issue
Block a user