mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
add slow_down_layers
This commit is contained in:
@@ -3370,6 +3370,19 @@ std::string GCodeGenerator::_extrude(
|
|||||||
m_config.get_abs_value("first_layer_speed", speed);
|
m_config.get_abs_value("first_layer_speed", speed);
|
||||||
else if (this->object_layer_over_raft())
|
else if (this->object_layer_over_raft())
|
||||||
speed = m_config.get_abs_value("first_layer_speed_over_raft", speed);
|
speed = m_config.get_abs_value("first_layer_speed_over_raft", speed);
|
||||||
|
//w25
|
||||||
|
else if (m_config.slow_down_layers > 1) {
|
||||||
|
const auto _layer = layer_id() + 1;
|
||||||
|
if (_layer > 0 && _layer < m_config.slow_down_layers) {
|
||||||
|
const auto first_layer_speed = (path_attr.role==ExtrusionRole::Perimeter||path_attr.role==ExtrusionRole::ExternalPerimeter) ? m_config.get_abs_value("first_layer_speed") :
|
||||||
|
m_config.get_abs_value("first_layer_infill_speed");
|
||||||
|
if (first_layer_speed < speed) {
|
||||||
|
speed = std::min(speed, Slic3r::lerp(first_layer_speed, speed, (double) _layer / m_config.slow_down_layers));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::pair<float, float> dynamic_speed_and_fan_speed{-1, -1};
|
std::pair<float, float> dynamic_speed_and_fan_speed{-1, -1};
|
||||||
if (path_attr.overhang_attributes.has_value()) {
|
if (path_attr.overhang_attributes.has_value()) {
|
||||||
|
|||||||
@@ -465,6 +465,13 @@ private:
|
|||||||
|
|
||||||
// On the first printing layer. This flag triggers first layer speeds.
|
// On the first printing layer. This flag triggers first layer speeds.
|
||||||
bool on_first_layer() const { return m_layer != nullptr && m_layer->id() == 0; }
|
bool on_first_layer() const { return m_layer != nullptr && m_layer->id() == 0; }
|
||||||
|
//w25
|
||||||
|
int layer_id() const
|
||||||
|
{
|
||||||
|
if (m_layer == nullptr)
|
||||||
|
return -1;
|
||||||
|
return m_layer->id();
|
||||||
|
}
|
||||||
// To control print speed of 1st object layer over raft interface.
|
// To control print speed of 1st object layer over raft interface.
|
||||||
bool object_layer_over_raft() const { return m_object_layer_over_raft; }
|
bool object_layer_over_raft() const { return m_object_layer_over_raft; }
|
||||||
|
|
||||||
|
|||||||
@@ -483,6 +483,8 @@ static std::vector<std::string> s_Preset_print_options {
|
|||||||
,"filter_top_gap_infill"
|
,"filter_top_gap_infill"
|
||||||
//w23
|
//w23
|
||||||
,"only_one_wall_first_layer"
|
,"only_one_wall_first_layer"
|
||||||
|
//w25
|
||||||
|
,"slow_down_layers"
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::vector<std::string> s_Preset_filament_options {
|
static std::vector<std::string> s_Preset_filament_options {
|
||||||
|
|||||||
@@ -251,7 +251,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|
|||||||
|| opt_key == "first_layer_travel_speed"
|
|| opt_key == "first_layer_travel_speed"
|
||||||
//B37
|
//B37
|
||||||
|| opt_key == "first_layer_infill_speed"
|
|| opt_key == "first_layer_infill_speed"
|
||||||
|| opt_key == "z_offset") {
|
|| opt_key == "z_offset"
|
||||||
|
//w25
|
||||||
|
|| opt_key == "slow_down_layers") {
|
||||||
steps.emplace_back(psWipeTower);
|
steps.emplace_back(psWipeTower);
|
||||||
steps.emplace_back(psSkirtBrim);
|
steps.emplace_back(psSkirtBrim);
|
||||||
} else if (opt_key == "filament_soluble") {
|
} else if (opt_key == "filament_soluble") {
|
||||||
|
|||||||
@@ -1482,6 +1482,16 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
def->set_default_value(new ConfigOptionFloatOrPercent(30, false));
|
def->set_default_value(new ConfigOptionFloatOrPercent(30, false));
|
||||||
|
|
||||||
|
//w25
|
||||||
|
def = this->add("slow_down_layers", coInt);
|
||||||
|
def->label = L("Number of slow layers");
|
||||||
|
def->tooltip = L("The first few layers are printed slower than normal. "
|
||||||
|
"The speed is gradually increased in a linear fashion over the specified number of layers.");
|
||||||
|
def->category = L("Speed");
|
||||||
|
def->min = 0;
|
||||||
|
def->mode = comAdvanced;
|
||||||
|
def->set_default_value(new ConfigOptionInt(0));
|
||||||
|
|
||||||
def = this->add("first_layer_temperature", coInts);
|
def = this->add("first_layer_temperature", coInts);
|
||||||
def->label = L("First layer");
|
def->label = L("First layer");
|
||||||
def->full_label = L("First layer nozzle temperature");
|
def->full_label = L("First layer nozzle temperature");
|
||||||
|
|||||||
@@ -857,6 +857,8 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
|
|||||||
((ConfigOptionFloatOrPercent, first_layer_extrusion_width))
|
((ConfigOptionFloatOrPercent, first_layer_extrusion_width))
|
||||||
((ConfigOptionFloatOrPercent, first_layer_height))
|
((ConfigOptionFloatOrPercent, first_layer_height))
|
||||||
((ConfigOptionFloatOrPercent, first_layer_speed))
|
((ConfigOptionFloatOrPercent, first_layer_speed))
|
||||||
|
//w25
|
||||||
|
((ConfigOptionInt, slow_down_layers))
|
||||||
((ConfigOptionInts, first_layer_temperature))
|
((ConfigOptionInts, first_layer_temperature))
|
||||||
((ConfigOptionIntsNullable, idle_temperature))
|
((ConfigOptionIntsNullable, idle_temperature))
|
||||||
//B26
|
//B26
|
||||||
|
|||||||
@@ -1607,6 +1607,8 @@ void TabPrint::build()
|
|||||||
optgroup->append_single_option_line("first_layer_travel_speed");
|
optgroup->append_single_option_line("first_layer_travel_speed");
|
||||||
|
|
||||||
optgroup->append_single_option_line("first_layer_speed_over_raft");
|
optgroup->append_single_option_line("first_layer_speed_over_raft");
|
||||||
|
//w25
|
||||||
|
optgroup->append_single_option_line("slow_down_layers");
|
||||||
|
|
||||||
optgroup = page->new_optgroup(L("Acceleration control (advanced)"));
|
optgroup = page->new_optgroup(L("Acceleration control (advanced)"));
|
||||||
optgroup->append_single_option_line("external_perimeter_acceleration");
|
optgroup->append_single_option_line("external_perimeter_acceleration");
|
||||||
|
|||||||
Reference in New Issue
Block a user