From 80575cd269c4d162f3e4660bac1ff263e551b7f2 Mon Sep 17 00:00:00 2001 From: "salt.wei" Date: Tue, 27 Sep 2022 11:34:22 +0800 Subject: [PATCH] ENH: some change for external bridge 1 move thick bridge from support to quality page 2 Fix the issue that some times the external bridge angle is not the best, and the bridge line is not the shortest one. Signed-off-by: salt.wei Change-Id: Ie26570fb289898f6b62960f9333e79aa92c08ae4 --- src/libslic3r/BridgeDetector.cpp | 10 ++++++---- src/slic3r/GUI/ConfigManipulation.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/BridgeDetector.cpp b/src/libslic3r/BridgeDetector.cpp index 03d671db4..ee4b345cf 100644 --- a/src/libslic3r/BridgeDetector.cpp +++ b/src/libslic3r/BridgeDetector.cpp @@ -119,25 +119,27 @@ bool BridgeDetector::detect_angle(double bridge_direction_override) } double total_length = 0; + double arachored_length = 0; double max_length = 0; { Lines clipped_lines = intersection_ln(lines, clip_area); for (size_t i = 0; i < clipped_lines.size(); ++i) { const Line &line = clipped_lines[i]; + double len = line.length(); + total_length += len; if (expolygons_contain(this->_anchor_regions, line.a) && expolygons_contain(this->_anchor_regions, line.b)) { // This line could be anchored. - double len = line.length(); - total_length += len; + arachored_length += len; max_length = std::max(max_length, len); } } } - if (total_length == 0.) + if (arachored_length == 0.) continue; have_coverage = true; // Sum length of bridged lines. - candidates[i_angle].coverage = total_length; + candidates[i_angle].coverage = arachored_length / total_length; /* The following produces more correct results in some cases and more broken in others. TODO: investigate, as it looks more reliable than line clipping. */ // $directions_coverage{$angle} = sum(map $_->area, @{$self->coverage($angle)}) // 0; diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 7b6e35b7f..e800a4b32 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -508,7 +508,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co for (auto el : { "support_style", "support_base_pattern", "support_base_pattern_spacing", "support_angle", "support_interface_pattern", "support_interface_top_layers", "support_interface_bottom_layers", - "bridge_no_support", "thick_bridges", "max_bridge_length", "support_top_z_distance", + "bridge_no_support", "max_bridge_length", "support_top_z_distance", //BBS: add more support params to dependent of enable_support "support_type", "support_on_build_plate_only", "support_critical_regions_only", "support_object_xy_distance", "independent_support_layer_height"}) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index f85c6274a..936ea9435 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1782,6 +1782,7 @@ void TabPrint::build() optgroup = page->new_optgroup(L("Advanced"), L"param_advanced"); optgroup->append_single_option_line("wall_infill_order"); optgroup->append_single_option_line("bridge_flow"); + optgroup->append_single_option_line("thick_bridges"); optgroup->append_single_option_line("only_one_wall_top"); optgroup->append_single_option_line("detect_overhang_wall"); optgroup->append_single_option_line("reduce_crossing_wall"); @@ -1884,7 +1885,6 @@ void TabPrint::build() optgroup->append_single_option_line("support_object_xy_distance", "support#supportobject-xy-distance"); optgroup->append_single_option_line("bridge_no_support", "support#base-pattern"); optgroup->append_single_option_line("max_bridge_length", "support#base-pattern"); - optgroup->append_single_option_line("thick_bridges", "support#base-pattern"); //optgroup->append_single_option_line("independent_support_layer_height"); page = add_options_page(L("Others"), "advanced");