UI integration, new option for speed on overhangs

This commit is contained in:
PavelMikus 2022-12-05 12:56:17 +01:00 committed by Pavel Mikuš
parent 9d87257aec
commit 11353a4a5c
8 changed files with 24 additions and 5 deletions

View File

@ -2877,7 +2877,9 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de
speed = m_config.get_abs_value("perimeter_speed");
} else if (path.role() == erExternalPerimeter) {
speed = m_config.get_abs_value("external_perimeter_speed");
} else if (path.role() == erOverhangPerimeter || path.role() == erBridgeInfill) {
}else if (path.role() == erOverhangPerimeter){
speed = m_config.get_abs_value("overhang_speed");
} else if (path.role() == erBridgeInfill) {
speed = m_config.get_abs_value("bridge_speed");
} else if (path.role() == erInternalInfill) {
speed = m_config.get_abs_value("infill_speed");
@ -3002,12 +3004,13 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de
prev = p;
}
} else {
double overhang_speed = m_config.get_abs_value("overhang_speed");
std::string comment;
if (m_config.gcode_comments) {
comment = description;
comment += description_bridge;
}
double last_set_speed = std::max(5.0, new_points[0].speed_factor * speed) * 60.0;
double last_set_speed = std::max(overhang_speed, new_points[0].speed_factor * speed) * 60.0;
gcode += m_writer.set_speed(last_set_speed, "", comment);
Vec2d prev = this->point_to_gcode_quantized(new_points[0].p);
for (size_t i = 1; i < new_points.size(); i++) {
@ -3016,7 +3019,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de
const double line_length = (p - prev).norm();
gcode += m_writer.extrude_to_xy(p, e_per_mm * line_length, comment);
prev = p;
double new_speed = std::max(5.0, procesed_point.speed_factor * speed) * 60.0;
double new_speed = std::max(overhang_speed, procesed_point.speed_factor * speed) * 60.0;
if (last_set_speed != new_speed) {
gcode += m_writer.set_speed(new_speed, "", comment);
last_set_speed = new_speed;

View File

@ -428,7 +428,7 @@ static std::vector<std::string> s_Preset_print_options {
"max_print_speed", "max_volumetric_speed", "avoid_crossing_perimeters_max_detour",
"fuzzy_skin", "fuzzy_skin_thickness", "fuzzy_skin_point_dist",
"max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative",
"perimeter_speed", "small_perimeter_speed", "external_perimeter_speed", "infill_speed", "solid_infill_speed",
"perimeter_speed", "small_perimeter_speed", "external_perimeter_speed", "overhang_speed", "infill_speed", "solid_infill_speed",
"top_solid_infill_speed", "support_material_speed", "support_material_xy_spacing", "support_material_interface_speed",
"bridge_speed", "gap_fill_speed", "gap_fill_enabled", "travel_speed", "travel_speed_z", "first_layer_speed", "first_layer_speed_over_raft", "perimeter_acceleration", "infill_acceleration",
"bridge_acceleration", "first_layer_acceleration", "first_layer_acceleration_over_raft", "default_acceleration", "skirts", "skirt_distance", "skirt_height", "draft_shield",

View File

@ -2358,6 +2358,18 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(15, false));
def = this->add("overhang_speed", coFloatOrPercent);
def->label = L("Overhangs");
def->category = L("Speed");
def->tooltip = L("This setting controls the speed of overhangs."
"If expressed as percentage (for example: 80%) it will be calculated "
"on the external perimeters speed setting. Set to zero for auto.");
def->sidetext = L("mm/s or %");
def->ratio_over = "external_perimeter_speed";
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(5, false));
def = this->add("solid_infill_below_area", coFloat);
def->label = L("Solid infill threshold area");
def->category = L("Infill");

View File

@ -564,6 +564,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionEnum<InfillPattern>, bottom_fill_pattern))
((ConfigOptionFloatOrPercent, external_perimeter_extrusion_width))
((ConfigOptionFloatOrPercent, external_perimeter_speed))
((ConfigOptionFloatOrPercent, overhang_speed))
((ConfigOptionBool, external_perimeters_first))
((ConfigOptionBool, extra_perimeters))
((ConfigOptionBool, extra_perimeters_on_overhangs))

View File

@ -748,6 +748,7 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "support_material_speed"
|| opt_key == "support_material_interface_speed"
|| opt_key == "bridge_speed"
|| opt_key == "overhang_speed"
|| opt_key == "external_perimeter_speed"
|| opt_key == "infill_speed"
|| opt_key == "perimeter_speed"

View File

@ -220,7 +220,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
bool have_perimeters = config->opt_int("perimeters") > 0;
for (auto el : { "extra_perimeters","extra_perimeters_on_overhangs", "ensure_vertical_shell_thickness", "thin_walls", "overhangs",
"seam_position","staggered_inner_seams", "external_perimeters_first", "external_perimeter_extrusion_width",
"perimeter_speed", "small_perimeter_speed", "external_perimeter_speed" })
"perimeter_speed", "small_perimeter_speed", "external_perimeter_speed", "overhang_speed" })
toggle_field(el, have_perimeters);
bool have_infill = config->option<ConfigOptionPercent>("fill_density")->value > 0;

View File

@ -100,6 +100,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
double bridge_flow_ratio = print_config.opt_float("bridge_flow_ratio");
double perimeter_speed = print_config.opt_float("perimeter_speed");
double external_perimeter_speed = print_config.get_abs_value("external_perimeter_speed", perimeter_speed);
// double overhang_seed = print_config.get_abs_value("overhang_speed", external_perimeter_speed);
// double gap_fill_speed = print_config.opt_bool("gap_fill_enabled") ? print_config.opt_float("gap_fill_speed") : 0.;
double infill_speed = print_config.opt_float("infill_speed");
double small_perimeter_speed = print_config.get_abs_value("small_perimeter_speed", perimeter_speed);

View File

@ -1541,6 +1541,7 @@ void TabPrint::build()
optgroup->append_single_option_line("perimeter_speed");
optgroup->append_single_option_line("small_perimeter_speed");
optgroup->append_single_option_line("external_perimeter_speed");
optgroup->append_single_option_line("overhang_speed");
optgroup->append_single_option_line("infill_speed");
optgroup->append_single_option_line("solid_infill_speed");
optgroup->append_single_option_line("top_solid_infill_speed");