diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index c2a87e785f..578c453344 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -464,10 +464,12 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: #endif } + LayerRegion* layerm = this->m_regions[surface_fill.region_id]; + // Maximum length of the perimeter segment linking two infill lines. f->link_max_length = (coord_t)scale_(link_max_length); // Used by the concentric infill pattern to clip the loops to create extrusion paths. - f->loop_clipping = coord_t(scale_(surface_fill.params.flow.nozzle_diameter()) * LOOP_CLIPPING_LENGTH_OVER_NOZZLE_DIAMETER); + f->loop_clipping = coord_t(scale_(layerm->region().config().seam_gap.get_abs_value(surface_fill.params.flow.nozzle_diameter()))); // apply half spacing using this flow's own spacing and generate infill FillParams params; @@ -486,7 +488,6 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: params.no_extrusion_overlap = surface_fill.params.overlap; params.with_loop = surface_fill.params.with_loop; - LayerRegion* layerm = this->m_regions[surface_fill.region_id]; params.config = &layerm->region().config(); for (ExPolygon& expoly : surface_fill.expolygons) { f->no_overlap_expolygons = intersection_ex(surface_fill.no_overlap_expolygons, ExPolygons() = {expoly}); diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 23df4191c9..89ab139c25 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3334,8 +3334,7 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou // if polyline was shorter than the clipping distance we'd get a null polyline, so // we discard it in that case double clip_length = m_enable_loop_clipping ? - scale_(EXTRUDER_CONFIG(nozzle_diameter)) * LOOP_CLIPPING_LENGTH_OVER_NOZZLE_DIAMETER : - 0; + scale_(m_config.seam_gap.get_abs_value(EXTRUDER_CONFIG(nozzle_diameter))) : 0; // get paths ExtrusionPaths paths; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index b8cd820810..202e89f97f 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -752,7 +752,7 @@ static std::vector 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", "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" + "print_flow_ratio","seam_gap" }; @@ -777,7 +777,7 @@ static std::vector s_Preset_filament_options { "filament_wipe_distance", "additional_cooling_fan_speed", "bed_temperature_difference", "nozzle_temperature_range_low", "nozzle_temperature_range_high", //SoftFever - "enable_pressure_advance", "pressure_advance","chamber_temperature" + "enable_pressure_advance", "pressure_advance","chamber_temperature" /*,"filament_seam_gap"*/ }; static std::vector s_Preset_machine_limits_options { diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index f48f5c29f3..d8360de327 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -148,7 +148,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "thumbnails", "nozzle_hrc", "required_nozzle_HRC", - "upward_compatible_machine" + "upward_compatible_machine", + // SoftFever + "seam_gap" }; static std::unordered_set steps_ignore; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index bbad230f88..30eaca1933 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2370,6 +2370,17 @@ void PrintConfigDef::init_fff_params() def->enum_labels.push_back(L("Random")); def->mode = comSimple; def->set_default_value(new ConfigOptionEnum(spAligned)); + + + def = this->add("seam_gap", coFloatOrPercent); + def->label = L("Seam gap"); + def->tooltip = L("To avoid visible seam, the extrusion can be stoppped a bit before the end of the loop." + "\nCan be a mm or a % of the current extruder diameter."); + def->sidetext = L("mm or %"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloatOrPercent(15,true)); + def = this->add("skirt_distance", coFloat); def->label = L("Skirt distance"); @@ -3351,7 +3362,7 @@ void PrintConfigDef::init_filament_option_keys() "retraction_length", "z_hop", "retraction_speed", "deretraction_speed", "retract_before_wipe", "retract_restart_extra", "retraction_minimum_travel", "wipe", "wipe_distance", "retract_when_changing_layer", "retract_length_toolchange", "retract_restart_extra_toolchange", "filament_colour", - "default_filament_profile" + "default_filament_profile"/*,"filament_seam_gap"*/ }; m_filament_retract_keys = { diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index eee8615824..2fc500dbc1 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -756,6 +756,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, only_one_wall_first_layer)) //SoftFever ((ConfigOptionFloat, print_flow_ratio)) + ((ConfigOptionFloatOrPercent, seam_gap)) ) PRINT_CONFIG_CLASS_DEFINE( diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index d85bd9d9a7..cc91839e95 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -679,7 +679,8 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "only_one_wall_first_layer" || opt_key == "initial_layer_line_width" || opt_key == "inner_wall_line_width" - || opt_key == "infill_wall_overlap") { + || opt_key == "infill_wall_overlap" + || opt_key == "seam_gap") { steps.emplace_back(posPerimeters); } else if (opt_key == "gap_infill_speed" || opt_key == "filter_out_gap_fill" ) { diff --git a/src/libslic3r/libslic3r.h b/src/libslic3r/libslic3r.h index 887931e244..fd24f69396 100644 --- a/src/libslic3r/libslic3r.h +++ b/src/libslic3r/libslic3r.h @@ -57,7 +57,8 @@ static constexpr double EPSILON = 1e-4; static constexpr double SCALING_FACTOR = 0.000001; static constexpr double PI = 3.141592653589793238; // When extruding a closed loop, the loop is interrupted and shortened a bit to reduce the seam. -static constexpr double LOOP_CLIPPING_LENGTH_OVER_NOZZLE_DIAMETER = 0.15; +// SoftFever: replaced by seam_gap now +// static constexpr double LOOP_CLIPPING_LENGTH_OVER_NOZZLE_DIAMETER = 0.15; static constexpr double RESOLUTION = 0.0125; #define SCALED_RESOLUTION (RESOLUTION / SCALING_FACTOR) static constexpr double SPARSE_INFILL_RESOLUTION = 0.04; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 1a495a2ff4..9d7ff1bf0a 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1834,6 +1834,8 @@ void TabPrint::build() optgroup = page->new_optgroup(L("Seam"), L"param_seam"); optgroup->append_single_option_line("seam_position", "Seam"); + optgroup->append_single_option_line("seam_gap","Seam"); + optgroup = page->new_optgroup(L("Precision"), L"param_precision"); optgroup->append_single_option_line("slice_closing_radius"); @@ -2468,7 +2470,9 @@ void TabFilament::add_filament_overrides_page() "filament_wipe", //BBS "filament_wipe_distance", - "filament_retract_before_wipe" + "filament_retract_before_wipe", + //SoftFever + // "filament_seam_gap" }) append_single_option_line(opt_key, extruder_idx); } @@ -2499,7 +2503,9 @@ void TabFilament::update_filament_overrides_page() "filament_wipe", //BBS "filament_wipe_distance", - "filament_retract_before_wipe" + "filament_retract_before_wipe", + //SoftFever + // "filament_seam_gap" }; const int extruder_idx = 0; // #ys_FIXME