From 03607bd97519a6a19ffc0f0530cc121a4959a7e2 Mon Sep 17 00:00:00 2001 From: "qing.zhang" Date: Fri, 24 Jan 2025 17:55:20 +0800 Subject: [PATCH] ENH: apply scarf seam on auto compensation circles Jira: none Signed-off-by: qing.zhang Change-Id: I339acf82ec1af9ed0a8f973e76b73c0eae608767 --- src/libslic3r/GCode.cpp | 3 +++ src/libslic3r/Preset.cpp | 2 +- src/libslic3r/PrintApply.cpp | 13 +++++++++++++ src/libslic3r/PrintConfig.cpp | 6 ++++++ src/libslic3r/PrintConfig.hpp | 1 + src/libslic3r/PrintObject.cpp | 3 ++- src/slic3r/GUI/Tab.cpp | 4 +++- 7 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 8bdba11d3..f17d367ba 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -4595,6 +4595,9 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou // get paths ExtrusionPaths paths; bool set_holes_and_compensation_speed = loop.get_customize_flag() && !loop.has_overhang_paths(); + if (set_holes_and_compensation_speed && m_config.apply_scarf_seam_on_circles.value) { + enable_seam_slope = true; + } loop.clip_end(clip_length, &paths); if (paths.empty()) return ""; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 21881995e..42f402a28 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -881,7 +881,7 @@ static std::vector s_Preset_print_options { "elefant_foot_compensation", "xy_contour_compensation", "xy_hole_compensation", "resolution", "enable_prime_tower", "prime_tower_width", "prime_tower_brim_width", "prime_tower_skip_points", "prime_tower_rib_wall","prime_tower_extra_rib_length","prime_tower_rib_width","prime_tower_fillet_wall", - "enable_circle_compensation", "circle_compensation_speed", "circle_compensation_manual_offset", + "enable_circle_compensation", "circle_compensation_speed", "circle_compensation_manual_offset", "apply_scarf_seam_on_circles", "counter_coef_1", "counter_coef_2", "counter_coef_3", "hole_coef_1", "hole_coef_2", "hole_coef_3", "counter_limit_min", "counter_limit_max", "hole_limit_min", "hole_limit_max", "diameter_limit", "wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits", diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index 870023158..d9ca4e4e9 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -1114,6 +1114,19 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ } } + { //check scarf seam setting + const auto &o = model.objects; + const bool has_scarf_joint_seam = std::any_of(o.begin(), o.end(), [&new_full_config](ModelObject *obj) { + return obj->get_config_value(new_full_config, "apply_scarf_seam_on_circles")->value; + }); + + if (has_scarf_joint_seam) { + new_full_config.set("has_scarf_joint_seam", true); + } + + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", has_scarf_joint_seam:" << has_scarf_joint_seam; + } + //apply extruder related values std::vector print_variant_index; if (!extruder_applied) { diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index d30bb5ed2..b9c6533b8 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -4201,6 +4201,12 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0.0)); + def = this->add("apply_scarf_seam_on_circles", coBool); + def->label = L("Scarf Seam On Compensation Circles"); + def->tooltip = L("Enable to apply scarf seam on the circle to have better assemble."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(true)); + def = this->add("circle_compensation_speed", coFloats); def->label = L("Circle Compensation Speed"); def->tooltip = L("circle_compensation_speed"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 7505089ba..1a96a4eb6 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -829,6 +829,7 @@ PRINT_CONFIG_CLASS_DEFINE( //BBS auto hole contour compensation ((ConfigOptionBool, enable_circle_compensation)) ((ConfigOptionFloat, circle_compensation_manual_offset)) + ((ConfigOptionBool, apply_scarf_seam_on_circles)) ((ConfigOptionBool, flush_into_objects)) // BBS ((ConfigOptionBool, flush_into_infill)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 5c88967ca..6894a03df 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -923,7 +923,8 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "inner_wall_line_width" || opt_key == "infill_wall_overlap" || opt_key == "enable_circle_compensation" - || opt_key == "circle_compensation_manual_offset") { + || opt_key == "circle_compensation_manual_offset" + || opt_key == "apply_scarf_seam_on_circles") { steps.emplace_back(posPerimeters); } else if (opt_key == "gap_infill_speed" || opt_key == "filter_out_gap_fill") { // Return true if gap-fill speed has changed from zero value to non-zero or from non-zero value to zero. diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index a31db51d7..1d9974be8 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2034,9 +2034,11 @@ void TabPrint::build() optgroup->append_single_option_line("enable_arc_fitting", "acr-move"); optgroup->append_single_option_line("xy_hole_compensation", "xy-hole-contour-compensation"); optgroup->append_single_option_line("xy_contour_compensation", "xy-hole-contour-compensation"); - optgroup->append_single_option_line("elefant_foot_compensation", "parameter/elephant-foot"); optgroup->append_single_option_line("enable_circle_compensation"); optgroup->append_single_option_line("circle_compensation_manual_offset"); + + optgroup->append_single_option_line("elefant_foot_compensation", "parameter/elephant-foot"); + optgroup->append_single_option_line("precise_z_height"); optgroup = page->new_optgroup(L("Ironing"), L"param_ironing");