mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-31 05:47:02 +00:00
Add configurable short wall/perimeter cleaning for Arachne (#2790)
* add feature to add configurable value to clean/remove short un-closed walls/perimeters, to improve print times and reduce stringing (and generally lead to a cleaner print). * fixes to short wall removal, which no longer affects bottom or top surfaces. allowed adjusting Top-surface threshold (renamed from One wall threshold for clarity) when short wall removal value is configured above default of 0.5. * small fix for toggle_line for min_width_top_surface, to only be visible if min_length_factor > 0.5 and arachne is enabled. * Use copy of input_params * revert `One wall threshold"` string change --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@@ -31,6 +31,11 @@ WallToolPathsParams make_paths_params(const int layer_id, const PrintObjectConfi
|
||||
if (const auto &min_feature_size_opt = print_object_config.min_feature_size)
|
||||
input_params.min_feature_size = min_feature_size_opt.value * 0.01 * min_nozzle_diameter;
|
||||
|
||||
if (const auto &min_wall_length_factor_opt = print_object_config.min_length_factor)
|
||||
input_params.min_length_factor = min_wall_length_factor_opt.value;
|
||||
else
|
||||
input_params.min_length_factor = 0.5f;
|
||||
|
||||
if (layer_id == 0) {
|
||||
if (const auto &initial_layer_min_bead_width_opt = print_object_config.initial_layer_min_bead_width)
|
||||
input_params.min_bead_width = initial_layer_min_bead_width_opt.value * 0.01 * min_nozzle_diameter;
|
||||
@@ -47,6 +52,8 @@ WallToolPathsParams make_paths_params(const int layer_id, const PrintObjectConfi
|
||||
|
||||
input_params.wall_transition_angle = print_object_config.wall_transition_angle.value;
|
||||
input_params.wall_distribution_count = print_object_config.wall_distribution_count.value;
|
||||
|
||||
input_params.is_top_or_bottom_layer = false; // Set to default value
|
||||
}
|
||||
|
||||
return input_params;
|
||||
@@ -671,7 +678,8 @@ void WallToolPaths::removeSmallLines(std::vector<VariableWidthLines> &toolpaths)
|
||||
coord_t min_width = std::numeric_limits<coord_t>::max();
|
||||
for (const ExtrusionJunction &j : line)
|
||||
min_width = std::min(min_width, j.w);
|
||||
if (line.is_odd && !line.is_closed && shorterThan(line, min_width / 2)) { // remove line
|
||||
// Only use min_length_factor for non-topmost, to prevent top gaps. Otherwise use default value.
|
||||
if (line.is_odd && !line.is_closed && shorterThan(line, m_params.is_top_or_bottom_layer ? (min_width / 2) : (min_width * m_params.min_length_factor))) { // remove line
|
||||
line = std::move(inset.back());
|
||||
inset.erase(--inset.end());
|
||||
line_idx--; // reconsider the current position
|
||||
|
||||
@@ -25,10 +25,12 @@ class WallToolPathsParams
|
||||
public:
|
||||
float min_bead_width;
|
||||
float min_feature_size;
|
||||
float min_length_factor;
|
||||
float wall_transition_length;
|
||||
float wall_transition_angle;
|
||||
float wall_transition_filter_deviation;
|
||||
int wall_distribution_count;
|
||||
bool is_top_or_bottom_layer;
|
||||
};
|
||||
|
||||
WallToolPathsParams make_paths_params(const int layer_id, const PrintObjectConfig &print_object_config, const PrintConfig &print_config);
|
||||
@@ -109,7 +111,7 @@ protected:
|
||||
/*!
|
||||
* Remove polylines shorter than half the smallest line width along that polyline.
|
||||
*/
|
||||
static void removeSmallLines(std::vector<VariableWidthLines> &toolpaths);
|
||||
void removeSmallLines(std::vector<VariableWidthLines> &toolpaths);
|
||||
|
||||
/*!
|
||||
* Simplifies the variable-width toolpaths by calling the simplify on every line in the toolpath using the provided
|
||||
|
||||
Reference in New Issue
Block a user