diff --git a/src/libslic3r/MultiMaterialSegmentation.cpp b/src/libslic3r/MultiMaterialSegmentation.cpp index a4b94aace..e118d8d12 100644 --- a/src/libslic3r/MultiMaterialSegmentation.cpp +++ b/src/libslic3r/MultiMaterialSegmentation.cpp @@ -1332,9 +1332,9 @@ static inline std::vector> mmu_segmentation_top_and_bott int granularity = 1; for (size_t i = 0; i < print_object.num_printing_regions(); ++ i) { const PrintRegionConfig &config = print_object.printing_region(i).config(); - max_top_layers = std::max(max_top_layers, config.top_shell_layers.value); - max_bottom_layers = std::max(max_bottom_layers, config.bottom_shell_layers.value); - granularity = std::max(granularity, std::max(config.top_shell_layers.value, config.bottom_shell_layers.value) - 1); + max_top_layers = std::max(max_top_layers, config.top_color_penetration_layers.value); + max_bottom_layers = std::max(max_bottom_layers, config.bottom_color_penetration_layers.value); + granularity = std::max(granularity, std::max(config.top_color_penetration_layers.value, config.bottom_color_penetration_layers.value) - 1); } // Project upwards pointing painted triangles over top surfaces, @@ -1473,9 +1473,9 @@ static inline std::vector> mmu_segmentation_top_and_bott // Minimum radius of a region to be printable. Used to filter regions by morphological opening. float small_region_threshold { 0.f }; // Maximum number of top layers for a queried color. - int top_shell_layers { 0 }; + int top_color_penetration_layers { 0 }; // Maximum number of bottom layers for a queried color. - int bottom_shell_layers { 0 }; + int bottom_color_penetration_layers { 0 }; //BBS: spacing according to width and layer height float extrusion_spacing{ 0.f }; }; @@ -1493,8 +1493,8 @@ static inline std::vector> mmu_segmentation_top_and_bott float nozzle_diamter = float(print_config.nozzle_diameter.get_at(config.wall_filament - 1)); float outer_wall_line_width = float(config.outer_wall_line_width) == 0.0 ? (default_line_width == 0.0 ? nozzle_diamter : default_line_width) : float(config.outer_wall_line_width.value); out.extrusion_width = std::max(out.extrusion_width, outer_wall_line_width); - out.top_shell_layers = std::max(out.top_shell_layers, config.top_shell_layers); - out.bottom_shell_layers = std::max(out.bottom_shell_layers, config.bottom_shell_layers); + out.top_color_penetration_layers = std::max(out.top_color_penetration_layers, config.top_color_penetration_layers); + out.bottom_color_penetration_layers = std::max(out.bottom_color_penetration_layers, config.bottom_color_penetration_layers); out.small_region_threshold = config.gap_infill_speed.get_at(print_object.print()->get_extruder_id(config.wall_filament - 1)) > 0 ? // Gap fill enabled. Enable a single line of 1/2 extrusion width. 0.5f * outer_wall_line_width : @@ -1527,7 +1527,7 @@ static inline std::vector> mmu_segmentation_top_and_bott append(triangles_by_color_top[color_idx][layer_idx + layer_idx_offset], top_ex); float offset = 0.f; ExPolygons layer_slices_trimmed = input_expolygons[layer_idx]; - for (int last_idx = int(layer_idx) - 1; last_idx > std::max(int(layer_idx - stat.top_shell_layers), int(0)); --last_idx) { + for (int last_idx = int(layer_idx) - 1; last_idx > std::max(int(layer_idx - stat.top_color_penetration_layers), int(0)); --last_idx) { //BBS: offset width should be 2*spacing to avoid too narrow area which has overlap of wall line //offset -= stat.extrusion_width ; offset -= (stat.extrusion_spacing + stat.extrusion_width); @@ -1547,7 +1547,7 @@ static inline std::vector> mmu_segmentation_top_and_bott append(triangles_by_color_bottom[color_idx][layer_idx + layer_idx_offset], bottom_ex); float offset = 0.f; ExPolygons layer_slices_trimmed = input_expolygons[layer_idx]; - for (size_t last_idx = layer_idx + 1; last_idx < std::min(layer_idx + stat.bottom_shell_layers, num_layers); ++last_idx) { + for (size_t last_idx = layer_idx + 1; last_idx < std::min(layer_idx + stat.bottom_color_penetration_layers, num_layers); ++last_idx) { //BBS: offset width should be 2*spacing to avoid too narrow area which has overlap of wall line //offset -= stat.extrusion_width; offset -= (stat.extrusion_spacing + stat.extrusion_width); diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index b0dd604d8..40edae11e 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -846,7 +846,7 @@ bool Preset::has_cali_lines(PresetBundle* preset_bundle) static std::vector s_Preset_print_options { "layer_height", "initial_layer_print_height", "wall_loops", "slice_closing_radius", "spiral_mode", "spiral_mode_smooth", "spiral_mode_max_xy_smoothing", "slicing_mode", "top_shell_layers", "top_shell_thickness", "bottom_shell_layers", "bottom_shell_thickness", "ensure_vertical_shell_thickness", "reduce_crossing_wall", "detect_thin_wall", - "detect_overhang_wall", + "detect_overhang_wall", "top_color_penetration_layers", "bottom_color_penetration_layers", "smooth_speed_discontinuity_area","smooth_coefficient", "seam_position", "wall_sequence", "is_infill_first", "sparse_infill_density", "sparse_infill_pattern", "sparse_infill_anchor", "sparse_infill_anchor_max", "top_surface_pattern", "bottom_surface_pattern", "internal_solid_infill_pattern", "infill_direction", "bridge_angle","infill_shift_step", "infill_rotate_step", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 4136ab0fa..aed8f09e8 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -4195,6 +4195,20 @@ void PrintConfigDef::init_fff_params() def->min = 0; def->set_default_value(new ConfigOptionFloat(0.6)); + def = this->add("top_color_penetration_layers", coInt); + def->label = L("Top color layers"); + def->category = L("Strength"); + def->tooltip = L("This is the number of layers affected by the top color."); + def->min = 1; + def->set_default_value(new ConfigOptionInt(4)); + + def = this->add("bottom_color_penetration_layers", coInt); + def->label = L("Bottom color layers"); + def->category = L("Strength"); + def->tooltip = L("This is the number of layers affected by the bottom color."); + def->min = 1; + def->set_default_value(new ConfigOptionInt(3)); + def = this->add("travel_speed", coFloats); def->label = L("Travel"); def->tooltip = L("Speed of travel which is faster and without extrusion"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 384f6b822..0bcd910fe 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -945,6 +945,8 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloatsNullable, top_surface_speed)) ((ConfigOptionFloatsOrPercentsNullable, small_perimeter_speed)) ((ConfigOptionFloatsNullable, small_perimeter_threshold)) + ((ConfigOptionInt, top_color_penetration_layers)) + ((ConfigOptionInt, bottom_color_penetration_layers)) //BBS ((ConfigOptionBoolsNullable, enable_overhang_speed)) ((ConfigOptionFloatsNullable, overhang_1_4_speed)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 6963c7784..5ebd1cb82 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1042,7 +1042,9 @@ bool PrintObject::invalidate_state_by_config_options( steps.emplace_back(posSupportMaterial); } else if ( opt_key == "bottom_shell_layers" - || opt_key == "top_shell_layers") { + || opt_key == "top_shell_layers" + || opt_key == "top_color_penetration_layers" + || opt_key == "bottom_color_penetration_layers") { steps.emplace_back(posSlice); #if (0) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 5c02cbfcc..f05a44bd9 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2082,9 +2082,11 @@ void TabPrint::build() optgroup->append_single_option_line("top_surface_pattern", "fill-patterns#Infill of the top surface and bottom surface"); optgroup->append_single_option_line("top_shell_layers"); optgroup->append_single_option_line("top_shell_thickness"); + optgroup->append_single_option_line("top_color_penetration_layers"); optgroup->append_single_option_line("bottom_surface_pattern", "fill-patterns#Infill of the top surface and bottom surface"); optgroup->append_single_option_line("bottom_shell_layers"); optgroup->append_single_option_line("bottom_shell_thickness"); + optgroup->append_single_option_line("bottom_color_penetration_layers"); optgroup->append_single_option_line("internal_solid_infill_pattern"); optgroup = page->new_optgroup(L("Sparse infill"), L"param_infill");