ENH: add option "remove_small_overhang"

Let the user choose remove or not.

Github issue: #1810
Jira: STUDIO-2992

Change-Id: I9c5e087d171d16d8d7318b36efe825a6cbc29c33
This commit is contained in:
Arthur 2023-05-31 15:05:28 +08:00 committed by Lane.Wei
parent 5ae0adde16
commit 0ce835dcd4
11 changed files with 27 additions and 7 deletions

View File

@ -7864,6 +7864,12 @@ msgid ""
"etc."
msgstr "仅对关键区域生成支撑,包括尖尾、悬臂等。"
msgid "Remove small overhangs"
msgstr "移除小悬空"
msgid "Remove small overhangs that possibly need no supports."
msgstr "移除可能并不需要支撑的小悬空。"
msgid "Top Z distance"
msgstr "顶部Z距离"

View File

@ -728,7 +728,8 @@ static std::vector<std::string> s_Preset_print_options {
"independent_support_layer_height",
"support_angle", "support_interface_top_layers", "support_interface_bottom_layers",
"support_interface_pattern", "support_interface_spacing", "support_interface_loop_pattern",
"support_top_z_distance", "support_on_build_plate_only","support_critical_regions_only", "bridge_no_support", "thick_bridges", "max_bridge_length", "print_sequence",
"support_top_z_distance", "support_on_build_plate_only","support_critical_regions_only", "support_remove_small_overhang",
"bridge_no_support", "thick_bridges", "max_bridge_length", "print_sequence",
"filename_format", "wall_filament", "support_bottom_z_distance",
"sparse_infill_filament", "solid_infill_filament", "support_filament", "support_interface_filament",
"ooze_prevention", "standby_temperature_delta", "interface_shells", "line_width", "initial_layer_line_width",

View File

@ -2566,6 +2566,13 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("support_remove_small_overhang", coBool);
def->label = L("Remove small overhangs");
def->category = L("Support");
def->tooltip = L("Remove small overhangs that possibly need no supports.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(true));
// BBS: change type to common float.
// It may be rounded to mulitple layer height when independent_support_layer_height is false.
def = this->add("support_top_z_distance", coFloat);
@ -4025,7 +4032,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
, "max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative"
#endif /* HAS_PRESSURE_EQUALIZER */
// BBS
, "support_sharp_tails","remove_small_overhangs", "support_with_sheath",
, "support_sharp_tails","support_remove_small_overhangs", "support_with_sheath",
"tree_support_branch_diameter_angle", "tree_support_collision_resolution", "tree_support_with_infill",
"small_perimeter_speed", "max_volumetric_speed", "max_print_speed",
"support_closing_radius",

View File

@ -649,6 +649,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, support_angle))
((ConfigOptionBool, support_on_build_plate_only))
((ConfigOptionBool, support_critical_regions_only))
((ConfigOptionBool, support_remove_small_overhang))
((ConfigOptionFloat, support_top_z_distance))
((ConfigOptionFloat, support_bottom_z_distance))
((ConfigOptionInt, enforce_support_layers))

View File

@ -762,6 +762,7 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "support_angle"
|| opt_key == "support_on_build_plate_only"
|| opt_key == "support_critical_regions_only"
|| opt_key == "support_remove_small_overhang"
|| opt_key == "enforce_support_layers"
|| opt_key == "support_filament"
|| opt_key == "support_line_width"

View File

@ -2351,7 +2351,8 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::top_contact_
return MyLayersPtr();
// BBS group overhang clusters
if (g_config_remove_small_overhangs) {
const bool config_remove_small_overhangs = m_object_config->support_remove_small_overhang.value;
if (config_remove_small_overhangs) {
std::vector<OverhangCluster> clusters;
double fw_scaled = scale_(m_object_config->line_width);
std::set<ExPolygon*> removed_overhang;

View File

@ -726,6 +726,7 @@ void TreeSupport::detect_overhangs(bool detect_first_sharp_tail_only)
const coordf_t max_bridge_length = scale_(config.max_bridge_length.value);
const bool bridge_no_support = max_bridge_length > 0;
const bool support_critical_regions_only = config.support_critical_regions_only.value;
const bool config_remove_small_overhangs = config.support_remove_small_overhang.value;
const int enforce_support_layers = config.enforce_support_layers.value;
const double area_thresh_well_supported = SQ(scale_(6));
const double length_thresh_well_supported = scale_(6);
@ -1043,7 +1044,7 @@ void TreeSupport::detect_overhangs(bool detect_first_sharp_tail_only)
auto blockers = m_object->slice_support_blockers();
m_object->project_and_append_custom_facets(false, EnforcerBlockerType::ENFORCER, enforcers);
m_object->project_and_append_custom_facets(false, EnforcerBlockerType::BLOCKER, blockers);
if (is_auto(stype) && g_config_remove_small_overhangs) {
if (is_auto(stype) && config_remove_small_overhangs) {
if (blockers.size() < m_object->layer_count())
blockers.resize(m_object->layer_count());
for (auto& cluster : overhangClusters) {

View File

@ -90,7 +90,6 @@ static constexpr bool RELATIVE_E_AXIS = 1;
//BBS: some global const config which user can not change, but developer can
static constexpr bool g_config_support_sharp_tails = true;
static constexpr bool g_config_remove_small_overhangs = true;
static constexpr float g_config_tree_support_collision_resolution = 0.2;
// Write slices as SVG images into out directory during the 2D processing of the slices.

View File

@ -597,6 +597,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
"bridge_no_support", "max_bridge_length", "support_top_z_distance", "support_bottom_z_distance",
//BBS: add more support params to dependent of enable_support
"support_type", "support_on_build_plate_only", "support_critical_regions_only",
"support_remove_small_overhang",
"support_object_xy_distance"/*, "independent_support_layer_height"*/})
toggle_field(el, have_support_material);
toggle_field("support_threshold_angle", have_support_material && is_auto(support_type));

View File

@ -57,6 +57,7 @@ static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_FFF =
// BBS
{ L("Support") , { "enable_support", "support_type", "support_threshold_angle",
"support_base_pattern", "support_on_build_plate_only","support_critical_regions_only",
"support_remove_small_overhang",
"support_base_pattern_spacing", "support_expansion"}},
//BBS
{ L("Flush options") , { "flush_into_infill", "flush_into_objects", "flush_into_support"} }
@ -83,7 +84,7 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::OBJECT_C
{"tree_support_brim_width", "",26}, {"tree_support_branch_angle", "",10}, {"tree_support_wall_count", "",11},//tree support
{"support_top_z_distance", "",13},{"support_bottom_z_distance", "",12},{"support_base_pattern", "",14},{"support_base_pattern_spacing", "",15},
{"support_interface_top_layers", "",16},{"support_interface_bottom_layers", "",17},{"support_interface_spacing", "",18},{"support_bottom_interface_spacing", "",19},
{"support_object_xy_distance", "",20}, {"bridge_no_support", "",21},{"max_bridge_length", "",22},{"support_critical_regions_only", "",23}
{"support_object_xy_distance", "",20}, {"bridge_no_support", "",21},{"max_bridge_length", "",22},{"support_critical_regions_only", "",23},{"support_remove_small_overhang","",27}
}},
{ L("Speed"), {{"support_speed", "",12}, {"support_interface_speed", "",13}
}}
@ -140,7 +141,7 @@ std::vector<SimpleSettingData> SettingsFactory::get_visible_options(const std::s
//Quality
"layer_height", "initial_layer_print_height", "adaptive_layer_height", "seam_position", "xy_hole_compensation", "xy_contour_compensation", "elefant_foot_compensation", "support_line_width",
//Support
"enable_support", "support_type", "support_threshold_angle", "support_on_build_plate_only", "support_critical_regions_only", "enforce_support_layers",
"enable_support", "support_type", "support_threshold_angle", "support_on_build_plate_only", "support_critical_regions_only", "enforce_support_layers","support_remove_small_overhang",
//tree support
"tree_support_wall_count",
//support

View File

@ -1950,6 +1950,7 @@ void TabPrint::build()
optgroup->append_single_option_line("support_threshold_angle", "support#threshold-angle");
optgroup->append_single_option_line("support_on_build_plate_only");
optgroup->append_single_option_line("support_critical_regions_only");
optgroup->append_single_option_line("support_remove_small_overhang");
//optgroup->append_single_option_line("enforce_support_layers");
optgroup = page->new_optgroup(L("Raft"), L"param_raft");