wipe on loops

Signed-off-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
SoftFever 2023-01-26 00:36:47 +08:00
parent 1f13b37f19
commit 854470cfba
7 changed files with 15 additions and 5 deletions

View file

@ -3395,7 +3395,7 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
}
// make a little move inwards before leaving loop
if (paths.back().role() == erExternalPerimeter && m_layer != NULL && m_config.wall_loops.value > 1 && paths.front().size() >= 2 && paths.back().polyline.points.size() >= 3) {
if (m_config.wipe_on_loops.value && paths.back().role() == erExternalPerimeter && m_layer != NULL && m_config.wall_loops.value > 1 && paths.front().size() >= 2 && paths.back().polyline.points.size() >= 3) {
// detect angle between last and first segment
// the side depends on the original winding order of the polygon (left for contours, right for holes)
//FIXME improve the algorithm in case the loop is tiny.

View file

@ -752,7 +752,7 @@ static std::vector<std::string> s_Preset_print_options {
"small_perimeter_speed", "small_perimeter_threshold","bridge_angle", "filter_out_gap_fill", "post_process", "travel_acceleration","inner_wall_acceleration",
"default_jerk", "outer_wall_jerk", "inner_wall_jerk", "infill_jerk", "top_surface_jerk", "initial_layer_jerk","travel_jerk",
"top_solid_infill_flow_ratio","bottom_solid_infill_flow_ratio","only_one_wall_first_layer",
"print_flow_ratio","seam_gap","role_based_wipe_speed","wipe_speed","accel_to_decel_enable", "accel_to_decel_factor"
"print_flow_ratio","seam_gap","role_based_wipe_speed","wipe_speed","accel_to_decel_enable", "accel_to_decel_factor", "wipe_on_loops"
};

View file

@ -154,7 +154,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"wipe_speed",
"use_relative_e_distances",
"accel_to_decel_enable",
"accel_to_decel_factor"
"accel_to_decel_factor",
"wipe_on_loops"
};
static std::unordered_set<std::string> steps_ignore;

View file

@ -2406,7 +2406,13 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L("The wipe speed is same as the current extrusion role's speed.\n"
"e.g. if wipe action is followed by a outer wall extrusion, the outer wall speed will be used for this wipe action.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def->set_default_value(new ConfigOptionBool(true));
def = this->add("wipe_on_loops", coBool);
def->label = L("Wipe on loops");
def->tooltip = L("Make a little move inwards before leaving loop");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(true));
def = this->add("wipe_speed", coFloatOrPercent);
def->label = L("Wipe speed");

View file

@ -759,6 +759,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloatOrPercent, seam_gap))
((ConfigOptionBool, role_based_wipe_speed))
((ConfigOptionFloatOrPercent, wipe_speed))
((ConfigOptionBool, wipe_on_loops))
)

View file

@ -682,6 +682,7 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "infill_wall_overlap"
|| opt_key == "seam_gap"
|| opt_key == "role_based_wipe_speed"
|| opt_key == "wipe_on_loops"
|| opt_key == "wipe_speed") {
steps.emplace_back(posPerimeters);
} else if (opt_key == "gap_infill_speed"

View file

@ -1837,7 +1837,8 @@ void TabPrint::build()
optgroup->append_single_option_line("seam_position", "Seam");
optgroup->append_single_option_line("seam_gap","Seam");
optgroup->append_single_option_line("role_based_wipe_speed","Seam");
optgroup->append_single_option_line("wipe_speed","Seam");
optgroup->append_single_option_line("wipe_speed", "Seam");
optgroup->append_single_option_line("wipe_on_loops","Seam");
optgroup = page->new_optgroup(L("Precision"), L"param_precision");