diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 14416cdef..c63d73b2c 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -643,7 +643,7 @@ std::string Preset::get_filament_type(std::string &display_filament_type) } static std::vector s_Preset_print_options { - "layer_height", "initial_layer_print_height", "wall_loops", "spiral_mode", + "layer_height", "initial_layer_print_height", "wall_loops", "slice_closing_radius", "spiral_mode", "top_shell_layers", "top_shell_thickness", "bottom_shell_layers", "bottom_shell_thickness", "reduce_crossing_wall", "detect_thin_wall", "detect_overhang_wall", "seam_position", "wall_infill_order", "sparse_infill_density", "sparse_infill_pattern", "top_surface_pattern", "bottom_surface_pattern", @@ -749,6 +749,7 @@ static std::vector s_Preset_sla_print_options { "support_object_elevation", "support_points_density_relative", "support_points_minimal_distance", + "slice_closing_radius", "pad_enable", "pad_wall_thickness", "pad_wall_height", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index ad4b89715..aa9f4b17e 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2059,6 +2059,16 @@ void PrintConfigDef::init_fff_params() def->mode = comDevelop; def->set_default_value(new ConfigOptionBool(false)); + def = this->add("slice_closing_radius", coFloat); + def->label = L("Slice gap closing radius"); + def->category = L("Quality"); + def->tooltip = L("Cracks smaller than 2x gap closing radius are being filled during the triangle mesh slicing. " + "The gap closing operation may reduce the final print resolution, therefore it is advisable to keep the value reasonably low."); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.049)); + def = this->add("enable_support", coBool); //BBS: remove material behind support def->label = L("Enable support"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index bef719e9a..6402c030a 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -580,6 +580,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloat, raft_first_layer_expansion)) ((ConfigOptionInt, raft_layers)) ((ConfigOptionEnum, seam_position)) + ((ConfigOptionFloat, slice_closing_radius)) ((ConfigOptionBool, enable_support)) // Automatic supports (generated based on support_threshold_angle). ((ConfigOptionEnum, support_type)) @@ -887,6 +888,8 @@ PRINT_CONFIG_CLASS_DEFINE( //Number of the layers needed for the exposure time fade [3;20] ((ConfigOptionInt, faded_layers))/*= 10*/ + ((ConfigOptionFloat, slice_closing_radius)) + // Enabling or disabling support creation ((ConfigOptionBool, supports_enable)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 84429764e..f99c9cb3a 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -679,7 +679,8 @@ bool PrintObject::invalidate_state_by_config_options( //BBS || opt_key == "adaptive_layer_height" || opt_key == "raft_layers" - || opt_key == "raft_contact_distance") { + || opt_key == "raft_contact_distance" + || opt_key == "slice_closing_radius") { steps.emplace_back(posSlice); } else if ( opt_key == "elefant_foot_compensation" diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 8c1172375..5c5ea48d5 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -136,7 +136,7 @@ static std::vector slice_volumes_inner( slicing_ranges.reserve(layer_ranges.size()); MeshSlicingParamsEx params_base; - params_base.closing_radius = g_config_slice_closing_radius; + params_base.closing_radius = print_object_config.slice_closing_radius.value; params_base.extra_offset = 0; params_base.trafo = object_trafo; //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. @@ -1040,7 +1040,7 @@ void PrintObject::slice_volumes() if (min_growth < 0.f || elfoot > 0.f) { // Apply the negative XY compensation. (the ones that is <0) ExPolygons trimming; - static const float eps = float(scale_(g_config_slice_closing_radius) * 1.5); + static const float eps = float(scale_(m_config.slice_closing_radius.value) * 1.5); if (elfoot > 0.f) { lslices_1st_layer = offset_ex(layer->merged(eps), -eps); trimming = Slic3r::elephant_foot_compensation(lslices_1st_layer, diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index f2a47f73d..f921d5977 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -930,7 +930,8 @@ bool SLAPrintObject::invalidate_state_by_config_options(const std::vectorsupport_slices = sd->support_tree_ptr->slice( - heights, float(g_config_slice_closing_radius)); + heights, float(po.config().slice_closing_radius.value)); } for (size_t i = 0; i < sd->support_slices.size() && i < po.m_slice_index.size(); ++i) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 98305ab44..e0106c9f6 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1764,6 +1764,7 @@ void TabPrint::build() optgroup->append_single_option_line("seam_position", "Seam"); optgroup = page->new_optgroup(L("Precision")); + optgroup->append_single_option_line("slice_closing_radius"); optgroup->append_single_option_line("resolution"); optgroup->append_single_option_line("enable_arc_fitting"); optgroup->append_single_option_line("xy_hole_compensation");