From 4379cbfd95cf522fddeb7ea9089d0a6f3ea1d61b Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 16 Dec 2024 13:13:22 +0100 Subject: [PATCH 01/14] Use different minimum layer time when layer has an overhang CURA-12352 --- include/FanSpeedLayerTime.h | 13 +++++++++---- include/LayerPlan.h | 1 + src/FffGcodeWriter.cpp | 1 + src/LayerPlan.cpp | 15 +++++++++++---- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/include/FanSpeedLayerTime.h b/include/FanSpeedLayerTime.h index bc6c00fc73..05554a886d 100644 --- a/include/FanSpeedLayerTime.h +++ b/include/FanSpeedLayerTime.h @@ -1,5 +1,5 @@ -//Copyright (c) 2020 Ultimaker B.V. -//CuraEngine is released under the terms of the AGPLv3 or higher. +// Copyright (c) 2020 Ultimaker B.V. +// CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef FAN_SPEED_LAYER_TIME_H #define FAN_SPEED_LAYER_TIME_H @@ -8,7 +8,7 @@ #include "settings/types/LayerIndex.h" #include "settings/types/Velocity.h" -namespace cura +namespace cura { /*! @@ -19,7 +19,7 @@ namespace cura * store these settings over and over again for each part, even though the * settings may be different for each part on a layer. */ -struct FanSpeedLayerTimeSettings +struct FanSpeedLayerTimeSettings { public: /*! @@ -28,6 +28,11 @@ struct FanSpeedLayerTimeSettings */ Duration cool_min_layer_time; + /*! + * Similar to Minimum layer time, but to be applied for layers that contain overhanging extrusion. + */ + Duration cool_min_layer_time_overhang; + /*! * "Regular/Maximum Fan Speed Threshold". If the layers take longer to print * than this, they'll use the regular fan speed. If they take shorter, we'll diff --git a/include/LayerPlan.h b/include/LayerPlan.h index 149138e9cb..449a3a3127 100644 --- a/include/LayerPlan.h +++ b/include/LayerPlan.h @@ -124,6 +124,7 @@ class LayerPlan : public NoCopy std::vector overhang_masks_; //!< The regions of a layer part where the walls overhang, calculated for multiple overhang angles. The latter is the most //!< overhanging. For a visual explanation of the result, see doc/gradual_overhang_speed.svg Shape seam_overhang_mask_; //!< The regions of a layer part where the walls overhang, specifically as defined for the seam + bool contains_overhang_{ false }; //!< Indicates whether this plan contains any overhanging extrusion Shape roofing_mask_; //!< The regions of a layer part where the walls are exposed to the air bool min_layer_time_used = false; //!< Wether or not the minimum layer time (cool_min_layer_time) was actually used in this layerplan. diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index 26a1995cfc..469d5f4854 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -318,6 +318,7 @@ void FffGcodeWriter::setConfigFanSpeedLayerTime() fan_speed_layer_time_settings_per_extruder.emplace_back(); FanSpeedLayerTimeSettings& fan_speed_layer_time_settings = fan_speed_layer_time_settings_per_extruder.back(); fan_speed_layer_time_settings.cool_min_layer_time = train.settings_.get("cool_min_layer_time"); + fan_speed_layer_time_settings.cool_min_layer_time_overhang = train.settings_.get("cool_min_layer_time_overhang"); fan_speed_layer_time_settings.cool_min_layer_time_fan_speed_max = train.settings_.get("cool_min_layer_time_fan_speed_max"); fan_speed_layer_time_settings.cool_fan_speed_0 = train.settings_.get("cool_fan_speed_0") * 100.0; fan_speed_layer_time_settings.cool_fan_speed_min = train.settings_.get("cool_fan_speed_min") * 100.0; diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index 690f789139..dcc92a4f40 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -569,8 +569,13 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( const double fan_speed, const bool travel_to_z) { - const auto add_extrusion_move = [&](const Point3LL& target, const Ratio& overhang_speed_factor = 1.0_r) + const auto add_extrusion_move = [&](const Point3LL& target, const std::optional speed_region_index = std::nullopt) { + const Ratio overhang_speed_factor = speed_region_index.has_value() ? overhang_masks_[speed_region_index.value()].speed_ratio : 1.0_r; + if (speed_region_index.has_value() && speed_region_index.value() > 0) + { + contains_overhang_ = true; + } addExtrusionMove(target, config, space_fill_type, flow, width_factor, spiralize, speed_factor * overhang_speed_factor, fan_speed, travel_to_z); }; @@ -659,7 +664,7 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( // Move to intersection at current region speed const Point2LL split_position = start + vector * intersection_parameter; - add_extrusion_move(split_position, overhang_masks_[actual_speed_region_index].speed_ratio); + add_extrusion_move(split_position, actual_speed_region_index); // Prepare for next move in different region actual_speed_region_index = next_speed_region_index; @@ -668,7 +673,7 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( else { // We cross no border, which means we can reach the end of the segment within the current speed region, so we are done - add_extrusion_move(p, overhang_masks_[actual_speed_region_index].speed_ratio); + add_extrusion_move(p, actual_speed_region_index); return; } } @@ -2562,7 +2567,9 @@ void LayerPlan::processFanSpeedAndMinimalLayerTime(Point2LL starting_position) { other_extr_plan_time += extruder_plan.estimates_.getTotalTime(); } - maximum_cool_min_layer_time = std::max(maximum_cool_min_layer_time, extruder_plan.fan_speed_layer_time_settings_.cool_min_layer_time); + + const FanSpeedLayerTimeSettings& settings = extruder_plan.fan_speed_layer_time_settings_; + maximum_cool_min_layer_time = std::max(maximum_cool_min_layer_time, contains_overhang_ ? settings.cool_min_layer_time_overhang : settings.cool_min_layer_time); // Modify fan speeds for the first layer(s) extruder_plan.processFanSpeedForFirstLayers(); From ca2211fcbab8e3bf521046ee99ea6e8bec3cf5eb Mon Sep 17 00:00:00 2001 From: wawanbreton Date: Thu, 9 Jan 2025 12:04:30 +0000 Subject: [PATCH 02/14] Apply clang-format --- src/LayerPlan.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index dcc92a4f40..7c8eef7ada 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -57,15 +57,14 @@ GCodePath* LayerPlan::getLatestPathWithConfig( { return &paths.back(); } - paths.emplace_back( - GCodePath{ .z_offset = z_offset, - .config = config, - .mesh = current_mesh_, - .space_fill_type = space_fill_type, - .flow = flow, - .width_factor = width_factor, - .spiralize = spiralize, - .speed_factor = speed_factor }); + paths.emplace_back(GCodePath{ .z_offset = z_offset, + .config = config, + .mesh = current_mesh_, + .space_fill_type = space_fill_type, + .flow = flow, + .width_factor = width_factor, + .spiralize = spiralize, + .speed_factor = speed_factor }); GCodePath* ret = &paths.back(); ret->skip_agressive_merge_hint = mode_skip_agressive_merge_; From 9de740ad0ccdd76a542d5d29b481941d1b373125 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 9 Jan 2025 13:58:17 +0100 Subject: [PATCH 03/14] Apply the minimum overhanging extrusion length CURA-12352 --- include/FanSpeedLayerTime.h | 7 +++++++ include/LayerPlan.h | 5 ++++- src/FffGcodeWriter.cpp | 1 + src/LayerPlan.cpp | 20 +++++++++++++++++--- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/include/FanSpeedLayerTime.h b/include/FanSpeedLayerTime.h index 05554a886d..dfcd77a775 100644 --- a/include/FanSpeedLayerTime.h +++ b/include/FanSpeedLayerTime.h @@ -4,6 +4,8 @@ #ifndef FAN_SPEED_LAYER_TIME_H #define FAN_SPEED_LAYER_TIME_H +#include + #include "settings/types/Duration.h" #include "settings/types/LayerIndex.h" #include "settings/types/Velocity.h" @@ -33,6 +35,11 @@ struct FanSpeedLayerTimeSettings */ Duration cool_min_layer_time_overhang; + /*! + * The specific minimum layer time for overhanging will be applied only if there is at least one overhanging segment longer that this threshold + */ + coord_t cool_min_layer_time_overhang_min_segment_length; + /*! * "Regular/Maximum Fan Speed Threshold". If the layers take longer to print * than this, they'll use the regular fan speed. If they take shorter, we'll diff --git a/include/LayerPlan.h b/include/LayerPlan.h index 449a3a3127..8ad1793b43 100644 --- a/include/LayerPlan.h +++ b/include/LayerPlan.h @@ -124,7 +124,10 @@ class LayerPlan : public NoCopy std::vector overhang_masks_; //!< The regions of a layer part where the walls overhang, calculated for multiple overhang angles. The latter is the most //!< overhanging. For a visual explanation of the result, see doc/gradual_overhang_speed.svg Shape seam_overhang_mask_; //!< The regions of a layer part where the walls overhang, specifically as defined for the seam - bool contains_overhang_{ false }; //!< Indicates whether this plan contains any overhanging extrusion + bool currently_overhanging_{ false }; //!< Indicates whether the last extrusion move was overhanging + coord_t current_overhang_length_{ 0 }; //!< When doing consecutive overhanging moves, this is the current accumulated overhanging length + coord_t max_overhang_length_{ 0 }; //!< From all consecutive overhanging moves in the layer, this is the longest one + Shape roofing_mask_; //!< The regions of a layer part where the walls are exposed to the air bool min_layer_time_used = false; //!< Wether or not the minimum layer time (cool_min_layer_time) was actually used in this layerplan. diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index 87a8b9284f..8848bbed2e 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -320,6 +320,7 @@ void FffGcodeWriter::setConfigFanSpeedLayerTime() FanSpeedLayerTimeSettings& fan_speed_layer_time_settings = fan_speed_layer_time_settings_per_extruder.back(); fan_speed_layer_time_settings.cool_min_layer_time = train.settings_.get("cool_min_layer_time"); fan_speed_layer_time_settings.cool_min_layer_time_overhang = train.settings_.get("cool_min_layer_time_overhang"); + fan_speed_layer_time_settings.cool_min_layer_time_overhang_min_segment_length = train.settings_.get("cool_min_layer_time_overhang_min_segment_length"); fan_speed_layer_time_settings.cool_min_layer_time_fan_speed_max = train.settings_.get("cool_min_layer_time_fan_speed_max"); fan_speed_layer_time_settings.cool_fan_speed_0 = train.settings_.get("cool_fan_speed_0") * 100.0; fan_speed_layer_time_settings.cool_fan_speed_min = train.settings_.get("cool_fan_speed_min") * 100.0; diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index dcc92a4f40..79dd1aa384 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -572,10 +572,22 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( const auto add_extrusion_move = [&](const Point3LL& target, const std::optional speed_region_index = std::nullopt) { const Ratio overhang_speed_factor = speed_region_index.has_value() ? overhang_masks_[speed_region_index.value()].speed_ratio : 1.0_r; - if (speed_region_index.has_value() && speed_region_index.value() > 0) + + const bool is_overhanging = speed_region_index.has_value() && speed_region_index.value() > 0; + + if (is_overhanging != currently_overhanging_) { - contains_overhang_ = true; + max_overhang_length_ = std::max(current_overhang_length_, max_overhang_length_); + current_overhang_length_ = 0; } + + if (is_overhanging && last_planned_position_.has_value()) + { + current_overhang_length_ += vSize(target.toPoint2LL() - last_planned_position_.value()); + } + + currently_overhanging_ = is_overhanging; + addExtrusionMove(target, config, space_fill_type, flow, width_factor, spiralize, speed_factor * overhang_speed_factor, fan_speed, travel_to_z); }; @@ -2569,7 +2581,9 @@ void LayerPlan::processFanSpeedAndMinimalLayerTime(Point2LL starting_position) } const FanSpeedLayerTimeSettings& settings = extruder_plan.fan_speed_layer_time_settings_; - maximum_cool_min_layer_time = std::max(maximum_cool_min_layer_time, contains_overhang_ ? settings.cool_min_layer_time_overhang : settings.cool_min_layer_time); + const bool apply_minimum_layer_time_overhang = max_overhang_length_ > settings.cool_min_layer_time_overhang_min_segment_length; + maximum_cool_min_layer_time + = std::max(maximum_cool_min_layer_time, apply_minimum_layer_time_overhang ? settings.cool_min_layer_time_overhang : settings.cool_min_layer_time); // Modify fan speeds for the first layer(s) extruder_plan.processFanSpeedForFirstLayers(); From 1953eb5ba8f985c90398aad26684c5aa5ea8f111 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 16 Jan 2025 08:23:12 +0100 Subject: [PATCH 04/14] Don't skip last speed-region w.r.t. overhang wall angles. part of CURA-12352 --- src/FffGcodeWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index d495c11eef..0304356751 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -3121,7 +3121,7 @@ bool FffGcodeWriter::processInsets( speed_regions.push_back(SpeedRegion{ wall_overhang_angle, 1.0_r }); // Initial internal region, always 100% speed factor - for (size_t angle_index = 1; angle_index < overhang_angles_count; ++angle_index) + for (size_t angle_index = 1; angle_index <= overhang_angles_count; ++angle_index) { const AngleDegrees actual_wall_overhang_angle = wall_overhang_angle + static_cast(angle_index) * overhang_step; const Ratio speed_factor = overhang_speed_factors[angle_index - 1]; From 0540d555e1f298c347fe4300916b5183c328f7bf Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 16 Jan 2025 08:29:44 +0100 Subject: [PATCH 05/14] There should always be an internal region, even if the speed is 100%. Even if the overhang wall speed is set to 100%, and thus wouldn't normally change, the minimum layer time for overhanging walls (split off from the minimum layer time, which is the whole point of this ticket) still should take effect -- which we can't detect if the merged regions are just one big everything blob. part of CURA-12352 --- src/FffGcodeWriter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index 0304356751..a21cdaabde 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -3112,6 +3112,7 @@ bool FffGcodeWriter::processInsets( { AngleDegrees overhang_angle; Ratio speed_factor; + bool chunk = true; }; // Create raw speed regions @@ -3119,7 +3120,8 @@ bool FffGcodeWriter::processInsets( std::vector speed_regions; speed_regions.reserve(overhang_angles_count + 1); - speed_regions.push_back(SpeedRegion{ wall_overhang_angle, 1.0_r }); // Initial internal region, always 100% speed factor + constexpr bool dont_chunk_first = false; + speed_regions.push_back(SpeedRegion{ wall_overhang_angle, 1.0_r, dont_chunk_first }); // Initial internal region, always 100% speed factor for (size_t angle_index = 1; angle_index <= overhang_angles_count; ++angle_index) { @@ -3136,7 +3138,7 @@ bool FffGcodeWriter::processInsets( | ranges::views::chunk_by( [](const auto& region_a, const auto& region_b) { - return region_a.speed_factor == region_b.speed_factor; + return region_a.chunk && region_b.chunk && region_a.speed_factor == region_b.speed_factor; }); // If finally necessary, add actual calculated speed regions From 7f2ced5c9bcc0f55552138f2b2f12b1c4de7a6e3 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 16 Jan 2025 08:31:43 +0100 Subject: [PATCH 06/14] Small optimization refactors. done as part of CURA-12352 --- src/FffGcodeWriter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index a21cdaabde..9728c00bf2 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -3118,20 +3118,20 @@ bool FffGcodeWriter::processInsets( // Create raw speed regions const AngleDegrees overhang_step = (90.0 - wall_overhang_angle) / static_cast(overhang_angles_count); std::vector speed_regions; - speed_regions.reserve(overhang_angles_count + 1); + speed_regions.reserve(overhang_angles_count + 2); constexpr bool dont_chunk_first = false; - speed_regions.push_back(SpeedRegion{ wall_overhang_angle, 1.0_r, dont_chunk_first }); // Initial internal region, always 100% speed factor + speed_regions.emplace_back(wall_overhang_angle, 1.0_r, dont_chunk_first); // Initial internal region, always 100% speed factor for (size_t angle_index = 1; angle_index <= overhang_angles_count; ++angle_index) { const AngleDegrees actual_wall_overhang_angle = wall_overhang_angle + static_cast(angle_index) * overhang_step; const Ratio speed_factor = overhang_speed_factors[angle_index - 1]; - speed_regions.push_back(SpeedRegion{ actual_wall_overhang_angle, speed_factor }); + speed_regions.emplace_back(actual_wall_overhang_angle, speed_factor); } - speed_regions.push_back(SpeedRegion{ 90.0, overhang_speed_factors.back() }); // Final "everything else" speed region + speed_regions.emplace_back(90.0, overhang_speed_factors.back()); // Final "everything else" speed region // Now merge regions that have similar speed factors (saves calculations and avoid generating micro-segments) auto merged_regions = speed_regions @@ -3147,7 +3147,7 @@ bool FffGcodeWriter::processInsets( for (const auto& regions : merged_regions) { const SpeedRegion& last_region = *ranges::prev(regions.end()); - overhang_masks.push_back(LayerPlan::OverhangMask{ get_supported_region(last_region.overhang_angle), last_region.speed_factor }); + overhang_masks.emplace_back(get_supported_region(last_region.overhang_angle), last_region.speed_factor); } } } From 93907a59c5c6dc78a575a02793b2e8d610eaf2f7 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 16 Jan 2025 11:07:15 +0100 Subject: [PATCH 07/14] Remove debugging code. --- src/LayerPlan.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index f46ed8bdb7..1e24015b3d 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -636,8 +636,6 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( } }; - const std::vector colors = { SVG::Color::RED, SVG::Color::GREEN, SVG::Color::BLUE, SVG::Color::YELLOW }; - // Now move along segment and split it where we cross speed regions while (true) { From 2cb9722b07f0450a2fafc599731130d36c3d7a7b Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 16 Jan 2025 11:09:37 +0100 Subject: [PATCH 08/14] Gradual overhang speed: Make sure to avoid microsegments. Since the speed regions can 'too' small as well, we need to make sure we don't create microsegments -- While there was already a mitigation earlier, Ihad to partially undo that to fix a bug, and now it's done in a more guaranteed, explicit way. part of CURA-12352 --- src/LayerPlan.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index 1e24015b3d..6f68ebc3ba 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -612,12 +612,40 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( // Pre-calculate the intersections of the segment with all regions (except last one, you cannot intersect an infinite plane) const Point2LL end = p.toPoint2LL(); const Point2LL vector = end - start; + const coord_t segment_length = vSize(vector); std::vector> speed_regions_intersections; speed_regions_intersections.reserve(overhang_masks_.size() - 1); for (const OverhangMask& overhang_region : overhang_masks_ | ranges::views::drop_last(1)) { std::vector intersections = overhang_region.supported_region.intersectionsWithSegment(start, end); ranges::sort(intersections); + + // Avoid microsegments: Move intersections that are too close to the start or end of the segment slightly more to the center of the segment. + for (float& intersection : intersections) + { + if (intersection * segment_length < MINIMUM_LINE_LENGTH) + { + intersection = MINIMUM_LINE_LENGTH / static_cast(segment_length); + } + else if (intersection * segment_length > segment_length - MINIMUM_LINE_LENGTH) + { + intersection = (segment_length - MINIMUM_LINE_LENGTH) / static_cast(segment_length); + } + } + + // (Also) Avoid microsegments: Filter out pairs of intersections that are too close to each other. + // This should be possible because the intersections happen in the same region. + constexpr std::array dummy = { 2.0f }; + std::vector temp_intersections; + for (const auto& tup : ranges::views::concat(dummy, intersections, dummy) | ranges::views::sliding(3)) + { + if ((tup[1] - tup[0]) * segment_length >= MINIMUM_LINE_LENGTH && (tup[2] - tup[1]) * segment_length >= MINIMUM_LINE_LENGTH) + { + temp_intersections.push_back(tup[1]); + } + } + intersections = temp_intersections; + speed_regions_intersections.push_back(intersections); } From ccf07dc82eb14509e90a6d68a5a8779a7396709d Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 16 Jan 2025 13:22:28 +0100 Subject: [PATCH 09/14] Update altered overhang wall-speed setting. part of CURA-12352 --- stress_benchmark/resources/001.settings | 2 +- stress_benchmark/resources/002.settings | 4 ++-- stress_benchmark/resources/003.settings | 4 ++-- stress_benchmark/resources/004.settings | 4 ++-- stress_benchmark/resources/005.settings | 4 ++-- stress_benchmark/resources/006.settings | 4 ++-- stress_benchmark/resources/007.settings | 4 ++-- stress_benchmark/resources/008.settings | 4 ++-- stress_benchmark/resources/009.settings | 4 ++-- stress_benchmark/resources/010.settings | 4 ++-- stress_benchmark/resources/011.settings | 4 ++-- stress_benchmark/resources/012.settings | 2 +- stress_benchmark/resources/013.settings | 2 +- stress_benchmark/resources/014.settings | 2 +- stress_benchmark/resources/015.settings | 2 +- stress_benchmark/resources/016.settings | 2 +- stress_benchmark/resources/017.settings | 2 +- stress_benchmark/resources/018.settings | 2 +- stress_benchmark/resources/019.settings | 2 +- stress_benchmark/resources/020.settings | 2 +- stress_benchmark/resources/021.settings | 2 +- stress_benchmark/resources/022.settings | 2 +- stress_benchmark/resources/024.settings | 2 +- stress_benchmark/resources/025.settings | 2 +- stress_benchmark/resources/026.settings | 2 +- stress_benchmark/resources/027.settings | 2 +- stress_benchmark/resources/028.settings | 2 +- stress_benchmark/resources/029.settings | 2 +- stress_benchmark/resources/030.settings | 2 +- stress_benchmark/resources/031.settings | 2 +- stress_benchmark/resources/032.settings | 2 +- stress_benchmark/resources/033.settings | 2 +- stress_benchmark/resources/034.settings | 2 +- stress_benchmark/resources/035.settings | 2 +- stress_benchmark/resources/036.settings | 2 +- stress_benchmark/resources/037.settings | 2 +- stress_benchmark/resources/038.settings | 2 +- stress_benchmark/resources/039.settings | 2 +- stress_benchmark/resources/040.settings | 2 +- stress_benchmark/resources/041.settings | 2 +- stress_benchmark/resources/042.settings | 2 +- stress_benchmark/resources/043.settings | 2 +- stress_benchmark/resources/044.settings | 2 +- stress_benchmark/resources/045.settings | 2 +- stress_benchmark/resources/046.settings | 2 +- stress_benchmark/resources/047.settings | 2 +- stress_benchmark/resources/048.settings | 2 +- stress_benchmark/resources/049.settings | 2 +- stress_benchmark/resources/050.settings | 2 +- stress_benchmark/resources/051.settings | 2 +- stress_benchmark/resources/052.settings | 2 +- stress_benchmark/resources/053.settings | 2 +- stress_benchmark/resources/055.settings | 2 +- stress_benchmark/resources/056.settings | 2 +- stress_benchmark/resources/058.settings | 2 +- stress_benchmark/resources/059.settings | 2 +- stress_benchmark/resources/060.settings | 2 +- stress_benchmark/resources/062.settings | 2 +- stress_benchmark/resources/065.settings | 2 +- stress_benchmark/resources/066.settings | 2 +- tests/test_default_settings.txt | 4 ++-- 61 files changed, 72 insertions(+), 72 deletions(-) diff --git a/stress_benchmark/resources/001.settings b/stress_benchmark/resources/001.settings index 931ebb30f7..1d888b2803 100644 --- a/stress_benchmark/resources/001.settings +++ b/stress_benchmark/resources/001.settings @@ -516,7 +516,7 @@ acceleration_support_roof=300 material_print_temp_wait=True support_roof_angles=[] machine_gcode_flavor=Griffin -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] jerk_support_infill=12.5 wall_0_wipe_dist=0 jerk_wall_0_roofing=12.5 diff --git a/stress_benchmark/resources/002.settings b/stress_benchmark/resources/002.settings index f13bb38240..3c14f3fc33 100644 --- a/stress_benchmark/resources/002.settings +++ b/stress_benchmark/resources/002.settings @@ -584,7 +584,7 @@ adaptive_layer_height_threshold=0.1 support_interface_height=0.8 support_brim_enable=True jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] acceleration_travel=500 support_bottom_material_flow=100 raft_base_extruder_nr=0 @@ -972,7 +972,7 @@ extruder_prime_pos_abs=False support_tower_maximum_supported_diameter=3.0 support_tree_angle=45 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] infill_before_walls=False material=0 brim_width=8.0 diff --git a/stress_benchmark/resources/003.settings b/stress_benchmark/resources/003.settings index c5d0242164..c902158b8f 100644 --- a/stress_benchmark/resources/003.settings +++ b/stress_benchmark/resources/003.settings @@ -585,7 +585,7 @@ adaptive_layer_height_threshold=0.2 support_interface_height=0.96 support_brim_enable=True jerk_support_infill=12.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] acceleration_travel=500 support_bottom_material_flow=95.0 raft_base_extruder_nr=0 @@ -973,7 +973,7 @@ extruder_prime_pos_abs=False support_tower_maximum_supported_diameter=3.0 support_tree_angle=50 jerk_support_infill=12.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] infill_before_walls=False material=0 brim_width=8.0 diff --git a/stress_benchmark/resources/004.settings b/stress_benchmark/resources/004.settings index ec29d4a421..c05afc0970 100644 --- a/stress_benchmark/resources/004.settings +++ b/stress_benchmark/resources/004.settings @@ -585,7 +585,7 @@ adaptive_layer_height_threshold=0.2 support_interface_height=0.8 support_brim_enable=True jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] acceleration_travel=500 support_bottom_material_flow=100 raft_base_extruder_nr=0 @@ -973,7 +973,7 @@ extruder_prime_pos_abs=False support_tower_maximum_supported_diameter=3.0 support_tree_angle=55 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] infill_before_walls=False material=0 brim_width=8.0 diff --git a/stress_benchmark/resources/005.settings b/stress_benchmark/resources/005.settings index 7858e603c1..297de77cd1 100644 --- a/stress_benchmark/resources/005.settings +++ b/stress_benchmark/resources/005.settings @@ -586,7 +586,7 @@ adaptive_layer_height_threshold=0.2 support_interface_height=0.8 support_brim_enable=True jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] acceleration_travel=500 support_bottom_material_flow=100 raft_base_extruder_nr=0 @@ -974,7 +974,7 @@ extruder_prime_pos_abs=False support_tower_maximum_supported_diameter=3.0 support_tree_angle=65.0 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] infill_before_walls=False material=0 brim_width=3 diff --git a/stress_benchmark/resources/006.settings b/stress_benchmark/resources/006.settings index fd1a670e71..bf2a3f294b 100644 --- a/stress_benchmark/resources/006.settings +++ b/stress_benchmark/resources/006.settings @@ -586,7 +586,7 @@ adaptive_layer_height_threshold=0.2 support_interface_height=0.8 support_brim_enable=True jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] acceleration_travel=500 support_bottom_material_flow=100 raft_base_extruder_nr=0 @@ -974,7 +974,7 @@ extruder_prime_pos_abs=False support_tower_maximum_supported_diameter=3.0 support_tree_angle=60.0 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] infill_before_walls=False material=0 brim_width=8.0 diff --git a/stress_benchmark/resources/007.settings b/stress_benchmark/resources/007.settings index 7459a9b0a7..9e15ba53d2 100644 --- a/stress_benchmark/resources/007.settings +++ b/stress_benchmark/resources/007.settings @@ -586,7 +586,7 @@ adaptive_layer_height_threshold=0.2 support_interface_height=0.8 support_brim_enable=True jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] acceleration_travel=500 support_bottom_material_flow=100 raft_base_extruder_nr=0 @@ -974,7 +974,7 @@ extruder_prime_pos_abs=False support_tower_maximum_supported_diameter=3.0 support_tree_angle=45 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] infill_before_walls=False material=0 brim_width=8.0 diff --git a/stress_benchmark/resources/008.settings b/stress_benchmark/resources/008.settings index d85ffc3226..ce9d96897b 100644 --- a/stress_benchmark/resources/008.settings +++ b/stress_benchmark/resources/008.settings @@ -252,7 +252,7 @@ travel_speed=150 speed=0 cool_fan_speed_min=50 wipe_move_distance=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] jerk_support_infill=20 material_adhesion_tendency=10 extruder_prime_pos_abs=True @@ -816,7 +816,7 @@ optimize_wall_printing_order=True line_width=0.4 switch_extruder_prime_speed=20 min_bead_width=0.34 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] jerk_support_infill=20 material_adhesion_tendency=0 extruder_prime_pos_abs=True diff --git a/stress_benchmark/resources/009.settings b/stress_benchmark/resources/009.settings index d85ffc3226..ce9d96897b 100644 --- a/stress_benchmark/resources/009.settings +++ b/stress_benchmark/resources/009.settings @@ -252,7 +252,7 @@ travel_speed=150 speed=0 cool_fan_speed_min=50 wipe_move_distance=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] jerk_support_infill=20 material_adhesion_tendency=10 extruder_prime_pos_abs=True @@ -816,7 +816,7 @@ optimize_wall_printing_order=True line_width=0.4 switch_extruder_prime_speed=20 min_bead_width=0.34 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] jerk_support_infill=20 material_adhesion_tendency=0 extruder_prime_pos_abs=True diff --git a/stress_benchmark/resources/010.settings b/stress_benchmark/resources/010.settings index d85ffc3226..ce9d96897b 100644 --- a/stress_benchmark/resources/010.settings +++ b/stress_benchmark/resources/010.settings @@ -252,7 +252,7 @@ travel_speed=150 speed=0 cool_fan_speed_min=50 wipe_move_distance=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] jerk_support_infill=20 material_adhesion_tendency=10 extruder_prime_pos_abs=True @@ -816,7 +816,7 @@ optimize_wall_printing_order=True line_width=0.4 switch_extruder_prime_speed=20 min_bead_width=0.34 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] jerk_support_infill=20 material_adhesion_tendency=0 extruder_prime_pos_abs=True diff --git a/stress_benchmark/resources/011.settings b/stress_benchmark/resources/011.settings index 65b9e99e25..9a87ff69f9 100644 --- a/stress_benchmark/resources/011.settings +++ b/stress_benchmark/resources/011.settings @@ -587,7 +587,7 @@ adaptive_layer_height_threshold=0.2 support_interface_height=1 support_brim_enable=True jerk_support_infill=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] acceleration_travel=5000 support_bottom_material_flow=100 raft_base_extruder_nr=0 @@ -974,7 +974,7 @@ extruder_prime_pos_abs=False support_tower_maximum_supported_diameter=3.0 support_tree_angle=50 jerk_support_infill=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] infill_before_walls=True material=0 brim_width=8.0 diff --git a/stress_benchmark/resources/012.settings b/stress_benchmark/resources/012.settings index 922ccbe0da..a5c84a5fd8 100644 --- a/stress_benchmark/resources/012.settings +++ b/stress_benchmark/resources/012.settings @@ -257,7 +257,7 @@ mesh_position_x=0 mold_width=5 adhesion_extruder_nr=0 jerk_support_infill=12.5 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] material_bed_temp_prepend=True infill_before_walls=False material=0 diff --git a/stress_benchmark/resources/013.settings b/stress_benchmark/resources/013.settings index 43d30644cc..7ede07d39e 100644 --- a/stress_benchmark/resources/013.settings +++ b/stress_benchmark/resources/013.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/014.settings b/stress_benchmark/resources/014.settings index 9a7e6974a8..7c75163949 100644 --- a/stress_benchmark/resources/014.settings +++ b/stress_benchmark/resources/014.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/015.settings b/stress_benchmark/resources/015.settings index 978ab42581..2efc3a746f 100644 --- a/stress_benchmark/resources/015.settings +++ b/stress_benchmark/resources/015.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/016.settings b/stress_benchmark/resources/016.settings index 650364a48f..7c69b499ae 100644 --- a/stress_benchmark/resources/016.settings +++ b/stress_benchmark/resources/016.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/017.settings b/stress_benchmark/resources/017.settings index 969525f8a4..fe0eb75df7 100644 --- a/stress_benchmark/resources/017.settings +++ b/stress_benchmark/resources/017.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=12.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.42 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/018.settings b/stress_benchmark/resources/018.settings index 6d53183cd2..163421e147 100644 --- a/stress_benchmark/resources/018.settings +++ b/stress_benchmark/resources/018.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/019.settings b/stress_benchmark/resources/019.settings index d4740b0130..bbd999a856 100644 --- a/stress_benchmark/resources/019.settings +++ b/stress_benchmark/resources/019.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/020.settings b/stress_benchmark/resources/020.settings index 569708996f..192fae0479 100644 --- a/stress_benchmark/resources/020.settings +++ b/stress_benchmark/resources/020.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.8 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/021.settings b/stress_benchmark/resources/021.settings index 43f5be7888..14d59c8302 100644 --- a/stress_benchmark/resources/021.settings +++ b/stress_benchmark/resources/021.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=30 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=1.0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/022.settings b/stress_benchmark/resources/022.settings index b5bb69424e..ebb2b050a6 100644 --- a/stress_benchmark/resources/022.settings +++ b/stress_benchmark/resources/022.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.42000000000000004 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/024.settings b/stress_benchmark/resources/024.settings index 2513007774..4e7493750a 100644 --- a/stress_benchmark/resources/024.settings +++ b/stress_benchmark/resources/024.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=10.0 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/025.settings b/stress_benchmark/resources/025.settings index 73e57d5143..18f0708d8b 100644 --- a/stress_benchmark/resources/025.settings +++ b/stress_benchmark/resources/025.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/026.settings b/stress_benchmark/resources/026.settings index c7c8346ba8..b815f15c7a 100644 --- a/stress_benchmark/resources/026.settings +++ b/stress_benchmark/resources/026.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/027.settings b/stress_benchmark/resources/027.settings index c1314905dc..a9192ae852 100644 --- a/stress_benchmark/resources/027.settings +++ b/stress_benchmark/resources/027.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/028.settings b/stress_benchmark/resources/028.settings index c3dd99ed05..d0ec43350d 100644 --- a/stress_benchmark/resources/028.settings +++ b/stress_benchmark/resources/028.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100.0 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/029.settings b/stress_benchmark/resources/029.settings index d0681a3d7a..cf36de465e 100644 --- a/stress_benchmark/resources/029.settings +++ b/stress_benchmark/resources/029.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/030.settings b/stress_benchmark/resources/030.settings index 3e3cae334c..9fd754cb6a 100644 --- a/stress_benchmark/resources/030.settings +++ b/stress_benchmark/resources/030.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=20 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/031.settings b/stress_benchmark/resources/031.settings index a94a42aa37..e53551ee84 100644 --- a/stress_benchmark/resources/031.settings +++ b/stress_benchmark/resources/031.settings @@ -45,7 +45,7 @@ cool_fan_speed_max=100 wall_overhang_angle=90 seam_overhang_angle=30 jerk_support_infill=8 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] support_roof_line_width=0.4 switch_extruder_extra_prime_amount=0 draft_shield_dist=10 diff --git a/stress_benchmark/resources/032.settings b/stress_benchmark/resources/032.settings index 1135de08d3..8a6e130c83 100644 --- a/stress_benchmark/resources/032.settings +++ b/stress_benchmark/resources/032.settings @@ -456,7 +456,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=8 machine_max_jerk_e=5.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=1.2000000000000002 layer_height_0=0.2 diff --git a/stress_benchmark/resources/033.settings b/stress_benchmark/resources/033.settings index c362b205af..0993838d18 100644 --- a/stress_benchmark/resources/033.settings +++ b/stress_benchmark/resources/033.settings @@ -458,7 +458,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=4 machine_max_jerk_e=5.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=0.8 layer_height_0=0.3 diff --git a/stress_benchmark/resources/034.settings b/stress_benchmark/resources/034.settings index a339aa7504..4365daf171 100644 --- a/stress_benchmark/resources/034.settings +++ b/stress_benchmark/resources/034.settings @@ -455,7 +455,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=4 machine_max_jerk_e=5 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=0.8 layer_height_0=0.2 diff --git a/stress_benchmark/resources/035.settings b/stress_benchmark/resources/035.settings index fa8458c460..dfa3672553 100644 --- a/stress_benchmark/resources/035.settings +++ b/stress_benchmark/resources/035.settings @@ -457,7 +457,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=5 machine_max_jerk_e=5 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=0.8 layer_height_0=0.2 diff --git a/stress_benchmark/resources/036.settings b/stress_benchmark/resources/036.settings index 8143588de7..5869f58a73 100644 --- a/stress_benchmark/resources/036.settings +++ b/stress_benchmark/resources/036.settings @@ -456,7 +456,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=7 machine_max_jerk_e=5 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=0.84 layer_height_0=0.12 diff --git a/stress_benchmark/resources/037.settings b/stress_benchmark/resources/037.settings index 95e29b5c7c..f52f188876 100644 --- a/stress_benchmark/resources/037.settings +++ b/stress_benchmark/resources/037.settings @@ -456,7 +456,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=8 machine_max_jerk_e=5 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=2.4 layer_height_0=0.2 diff --git a/stress_benchmark/resources/038.settings b/stress_benchmark/resources/038.settings index 6c110a5496..e13abd8021 100644 --- a/stress_benchmark/resources/038.settings +++ b/stress_benchmark/resources/038.settings @@ -457,7 +457,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=4 machine_max_jerk_e=5 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=0.8 layer_height_0=0.2 diff --git a/stress_benchmark/resources/039.settings b/stress_benchmark/resources/039.settings index 54dba7528d..7fef8dfdd6 100644 --- a/stress_benchmark/resources/039.settings +++ b/stress_benchmark/resources/039.settings @@ -457,7 +457,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=4 machine_max_jerk_e=5 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=0.8 layer_height_0=0.2 diff --git a/stress_benchmark/resources/040.settings b/stress_benchmark/resources/040.settings index c0b2b89dd1..b581d6d0b8 100644 --- a/stress_benchmark/resources/040.settings +++ b/stress_benchmark/resources/040.settings @@ -456,7 +456,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=4 machine_max_jerk_e=5.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=0.8 layer_height_0=0.3 diff --git a/stress_benchmark/resources/041.settings b/stress_benchmark/resources/041.settings index 07ee1c2630..095fbd4cf2 100644 --- a/stress_benchmark/resources/041.settings +++ b/stress_benchmark/resources/041.settings @@ -460,7 +460,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=6 machine_max_jerk_e=5 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=0.8 layer_height_0=0.2 diff --git a/stress_benchmark/resources/042.settings b/stress_benchmark/resources/042.settings index 8b81269ccd..a61a39d03a 100644 --- a/stress_benchmark/resources/042.settings +++ b/stress_benchmark/resources/042.settings @@ -457,7 +457,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=4 machine_max_jerk_e=5 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=50 skin_preshrink=0.8 layer_height_0=0.2 diff --git a/stress_benchmark/resources/043.settings b/stress_benchmark/resources/043.settings index 117014d94d..05ef23db74 100644 --- a/stress_benchmark/resources/043.settings +++ b/stress_benchmark/resources/043.settings @@ -459,7 +459,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=10 machine_max_jerk_e=5.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=95.0 skin_preshrink=0.8 layer_height_0=0.2 diff --git a/stress_benchmark/resources/044.settings b/stress_benchmark/resources/044.settings index 60f96d07d8..3ce627ee25 100644 --- a/stress_benchmark/resources/044.settings +++ b/stress_benchmark/resources/044.settings @@ -459,7 +459,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=17 machine_max_jerk_e=5.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=95.0 skin_preshrink=0.8 layer_height_0=0.2 diff --git a/stress_benchmark/resources/045.settings b/stress_benchmark/resources/045.settings index 8952ed5dc0..07447c71a2 100644 --- a/stress_benchmark/resources/045.settings +++ b/stress_benchmark/resources/045.settings @@ -458,7 +458,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=5 machine_max_jerk_e=5.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=95 skin_preshrink=1.6 layer_height_0=0.2 diff --git a/stress_benchmark/resources/046.settings b/stress_benchmark/resources/046.settings index 48d30b0005..fc8451b14f 100644 --- a/stress_benchmark/resources/046.settings +++ b/stress_benchmark/resources/046.settings @@ -458,7 +458,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=5 machine_max_jerk_e=5 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=0.8 layer_height_0=0.2 diff --git a/stress_benchmark/resources/047.settings b/stress_benchmark/resources/047.settings index 7f0aebca43..91b7e77a2e 100644 --- a/stress_benchmark/resources/047.settings +++ b/stress_benchmark/resources/047.settings @@ -458,7 +458,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=6 machine_max_jerk_e=5.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=1.2000000000000002 layer_height_0=0.2 diff --git a/stress_benchmark/resources/048.settings b/stress_benchmark/resources/048.settings index 5367dac44d..be9820e1f5 100644 --- a/stress_benchmark/resources/048.settings +++ b/stress_benchmark/resources/048.settings @@ -456,7 +456,7 @@ machine_extruders_share_nozzle=False meshfix_fluid_motion_shift_distance=0.1 top_layers=7 machine_max_jerk_e=5 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] bridge_skin_material_flow=60 skin_preshrink=1.6 layer_height_0=0.12 diff --git a/stress_benchmark/resources/049.settings b/stress_benchmark/resources/049.settings index 7971cfb8ec..097cc76f93 100644 --- a/stress_benchmark/resources/049.settings +++ b/stress_benchmark/resources/049.settings @@ -493,7 +493,7 @@ meshfix_extensive_stitching=False mesh_position_x=0 speed_wall=15.0 support_offset=0.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] top_layers=4 meshfix_fluid_motion_shift_distance=0.1 machine_max_jerk_e=5 diff --git a/stress_benchmark/resources/050.settings b/stress_benchmark/resources/050.settings index d26a8aac12..902172a462 100644 --- a/stress_benchmark/resources/050.settings +++ b/stress_benchmark/resources/050.settings @@ -494,7 +494,7 @@ mesh_position_x=0 speed_wall=80 quality_name=Fine support_offset=1.2000000000000002 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] top_layers=0 meshfix_fluid_motion_shift_distance=0.1 machine_max_jerk_e=5.0 diff --git a/stress_benchmark/resources/051.settings b/stress_benchmark/resources/051.settings index 35938d489c..ff46e5f93d 100644 --- a/stress_benchmark/resources/051.settings +++ b/stress_benchmark/resources/051.settings @@ -495,7 +495,7 @@ mesh_position_x=0 speed_wall=20.0 quality_name=Draft support_offset=0.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] top_layers=8 meshfix_fluid_motion_shift_distance=0.1 machine_max_jerk_e=5 diff --git a/stress_benchmark/resources/052.settings b/stress_benchmark/resources/052.settings index 113431270d..269b99e8c6 100644 --- a/stress_benchmark/resources/052.settings +++ b/stress_benchmark/resources/052.settings @@ -493,7 +493,7 @@ meshfix_extensive_stitching=False mesh_position_x=0 speed_wall=60 support_offset=0.88 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] top_layers=3 meshfix_fluid_motion_shift_distance=0.1 machine_max_jerk_e=5 diff --git a/stress_benchmark/resources/053.settings b/stress_benchmark/resources/053.settings index 6baab571ca..0fb91da637 100644 --- a/stress_benchmark/resources/053.settings +++ b/stress_benchmark/resources/053.settings @@ -497,7 +497,7 @@ speed_wall=40.0 quality_name=Fine support_offset=0.8 machine_gcode_flavor=UltiGCode -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] top_layers=8 meshfix_fluid_motion_shift_distance=0.1 machine_max_jerk_e=5.0 diff --git a/stress_benchmark/resources/055.settings b/stress_benchmark/resources/055.settings index 1e35ccf641..53d3f33367 100644 --- a/stress_benchmark/resources/055.settings +++ b/stress_benchmark/resources/055.settings @@ -496,7 +496,7 @@ mesh_position_x=0 speed_wall=30.0 quality_name=Normal support_offset=0.75 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] top_layers=4 meshfix_fluid_motion_shift_distance=0.1 machine_max_jerk_e=5 diff --git a/stress_benchmark/resources/056.settings b/stress_benchmark/resources/056.settings index de8686097c..4f8b695d2f 100644 --- a/stress_benchmark/resources/056.settings +++ b/stress_benchmark/resources/056.settings @@ -494,7 +494,7 @@ mesh_position_x=0 speed_wall=30.0 quality_name=Fine support_offset=0.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] top_layers=8 meshfix_fluid_motion_shift_distance=0.1 machine_max_jerk_e=5.0 diff --git a/stress_benchmark/resources/058.settings b/stress_benchmark/resources/058.settings index 2e325cc8c4..f75b3ddd6c 100644 --- a/stress_benchmark/resources/058.settings +++ b/stress_benchmark/resources/058.settings @@ -493,7 +493,7 @@ meshfix_extensive_stitching=False mesh_position_x=0 speed_wall=25.0 support_offset=0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] top_layers=7 meshfix_fluid_motion_shift_distance=0.1 machine_max_jerk_e=5 diff --git a/stress_benchmark/resources/059.settings b/stress_benchmark/resources/059.settings index 90b732ad2c..da3828fe8c 100644 --- a/stress_benchmark/resources/059.settings +++ b/stress_benchmark/resources/059.settings @@ -294,7 +294,7 @@ support_tree_rest_preference=graceful material_brand=empty_brand initial_bottom_layers=4 wipe_retraction_prime_speed=40 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] machine_heat_zone_length=16 support_bottom_stair_step_height=0 machine_nozzle_id=unknown diff --git a/stress_benchmark/resources/060.settings b/stress_benchmark/resources/060.settings index 69be168932..88de133ca0 100644 --- a/stress_benchmark/resources/060.settings +++ b/stress_benchmark/resources/060.settings @@ -294,7 +294,7 @@ support_tree_rest_preference=graceful material_brand=empty_brand initial_bottom_layers=7 wipe_retraction_prime_speed=20.0 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] machine_heat_zone_length=16 support_bottom_stair_step_height=0 machine_nozzle_id=unknown diff --git a/stress_benchmark/resources/062.settings b/stress_benchmark/resources/062.settings index cea763d01a..0cbbc973ee 100644 --- a/stress_benchmark/resources/062.settings +++ b/stress_benchmark/resources/062.settings @@ -294,7 +294,7 @@ support_tree_rest_preference=graceful material_brand=empty_brand initial_bottom_layers=4 wipe_retraction_prime_speed=45 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] machine_heat_zone_length=16 support_bottom_stair_step_height=0.3 machine_nozzle_id=unknown diff --git a/stress_benchmark/resources/065.settings b/stress_benchmark/resources/065.settings index 8cda003e03..01cf138b3e 100644 --- a/stress_benchmark/resources/065.settings +++ b/stress_benchmark/resources/065.settings @@ -297,7 +297,7 @@ support_tree_rest_preference=graceful material_brand=empty_brand initial_bottom_layers=8 wipe_retraction_prime_speed=45 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] machine_heat_zone_length=16 support_bottom_stair_step_height=0 prime_tower_size=20 diff --git a/stress_benchmark/resources/066.settings b/stress_benchmark/resources/066.settings index 664a9c8519..9aac810949 100644 --- a/stress_benchmark/resources/066.settings +++ b/stress_benchmark/resources/066.settings @@ -297,7 +297,7 @@ support_tree_rest_preference=graceful material_brand=empty_brand initial_bottom_layers=12 wipe_retraction_prime_speed=45 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] machine_heat_zone_length=16 support_bottom_stair_step_height=0 prime_tower_size=20 diff --git a/tests/test_default_settings.txt b/tests/test_default_settings.txt index 34b5d53147..6ba59ccc32 100644 --- a/tests/test_default_settings.txt +++ b/tests/test_default_settings.txt @@ -511,7 +511,7 @@ raft_interface_speed=27.5 raft_surface_infill_overlap_mm=0.0 bridge_skin_support_threshold=50 support_material_flow=100 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] material_type=empty wall_line_width_x=0.4 raft_base_acceleration=3000 @@ -1024,7 +1024,7 @@ raft_surface_infill_overlap_mm=0.0 bridge_skin_support_threshold=50 machine_extruder_start_pos_y=0 support_material_flow=100 -wall_overhang_speed_factor=100 +wall_overhang_speed_factors=[100] material_type=PLA command_line_settings=0 flow_anomaly_limit=25.0 From f3f26c7cb004c5484b9b641879fa2aaf0d32e1a2 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 16 Jan 2025 13:24:13 +0100 Subject: [PATCH 10/14] Make sure differences to detect min-line-lenght are positive values. part of CURA-12352 --- src/LayerPlan.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index 6f68ebc3ba..d593899fb0 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -639,7 +639,8 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( std::vector temp_intersections; for (const auto& tup : ranges::views::concat(dummy, intersections, dummy) | ranges::views::sliding(3)) { - if ((tup[1] - tup[0]) * segment_length >= MINIMUM_LINE_LENGTH && (tup[2] - tup[1]) * segment_length >= MINIMUM_LINE_LENGTH) + if (std::abs(tup[1] - tup[0]) * segment_length >= MINIMUM_LINE_LENGTH && + std::abs(tup[2] - tup[1]) * segment_length >= MINIMUM_LINE_LENGTH) { temp_intersections.push_back(tup[1]); } From 2353e640e22ba5c32cdc219983a3cdb03233b3fc Mon Sep 17 00:00:00 2001 From: rburema <41987080+rburema@users.noreply.github.com> Date: Thu, 16 Jan 2025 12:25:07 +0000 Subject: [PATCH 11/14] Apply clang-format --- src/LayerPlan.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index d593899fb0..5f8c873f96 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -639,8 +639,7 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( std::vector temp_intersections; for (const auto& tup : ranges::views::concat(dummy, intersections, dummy) | ranges::views::sliding(3)) { - if (std::abs(tup[1] - tup[0]) * segment_length >= MINIMUM_LINE_LENGTH && - std::abs(tup[2] - tup[1]) * segment_length >= MINIMUM_LINE_LENGTH) + if (std::abs(tup[1] - tup[0]) * segment_length >= MINIMUM_LINE_LENGTH && std::abs(tup[2] - tup[1]) * segment_length >= MINIMUM_LINE_LENGTH) { temp_intersections.push_back(tup[1]); } From a98e7d065fefa91bceab0789577915ea94e1f396 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 16 Jan 2025 14:22:11 +0100 Subject: [PATCH 12/14] Apple clang can't deal properly with emplace_back apparently. done as part of CURA-12352 --- src/FffGcodeWriter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index 9728c00bf2..1c12280a68 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -3121,17 +3121,17 @@ bool FffGcodeWriter::processInsets( speed_regions.reserve(overhang_angles_count + 2); constexpr bool dont_chunk_first = false; - speed_regions.emplace_back(wall_overhang_angle, 1.0_r, dont_chunk_first); // Initial internal region, always 100% speed factor + speed_regions.push_back(SpeedRegion{ wall_overhang_angle, 1.0_r, dont_chunk_first }); // Initial internal region, always 100% speed factor for (size_t angle_index = 1; angle_index <= overhang_angles_count; ++angle_index) { const AngleDegrees actual_wall_overhang_angle = wall_overhang_angle + static_cast(angle_index) * overhang_step; const Ratio speed_factor = overhang_speed_factors[angle_index - 1]; - speed_regions.emplace_back(actual_wall_overhang_angle, speed_factor); + speed_regions.push_back(SpeedRegion{ actual_wall_overhang_angle, speed_factor }); } - speed_regions.emplace_back(90.0, overhang_speed_factors.back()); // Final "everything else" speed region + speed_regions.push_back(SpeedRegion{ 90.0, overhang_speed_factors.back() }); // Final "everything else" speed region // Now merge regions that have similar speed factors (saves calculations and avoid generating micro-segments) auto merged_regions = speed_regions @@ -3147,7 +3147,7 @@ bool FffGcodeWriter::processInsets( for (const auto& regions : merged_regions) { const SpeedRegion& last_region = *ranges::prev(regions.end()); - overhang_masks.emplace_back(get_supported_region(last_region.overhang_angle), last_region.speed_factor); + overhang_masks.push_back(LayerPlan::OverhangMask{ get_supported_region(last_region.overhang_angle), last_region.speed_factor }); } } } From 588a83856f8db7a347a7cc8f88bbeff87a746a1c Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Wed, 22 Jan 2025 09:14:26 +0100 Subject: [PATCH 13/14] Improve micro-segment filtering CURA-12352 The previous method (filtering intersections) could cause jumps between non-adjacent speed regions, causing the wrong speed to be applied. Now we filter the micro-segments after applying the speed regions, and also re-merge consecutive segments that have the same speed. --- src/FffGcodeWriter.cpp | 2 +- src/LayerPlan.cpp | 130 +++++++++++++++++++++++++++-------------- 2 files changed, 86 insertions(+), 46 deletions(-) diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index 92a28321ac..fb7c68d323 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -3122,7 +3122,7 @@ bool FffGcodeWriter::processInsets( std::vector speed_regions; speed_regions.reserve(overhang_angles_count + 2); - constexpr bool dont_chunk_first = false; + constexpr bool dont_chunk_first = false; // Never merge internal region in order to detect actual overhanging speed_regions.push_back(SpeedRegion{ wall_overhang_angle, 1.0_r, dont_chunk_first }); // Initial internal region, always 100% speed factor for (size_t angle_index = 1; angle_index <= overhang_angles_count; ++angle_index) diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index e2143c0d38..74cf3794b7 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -57,14 +57,15 @@ GCodePath* LayerPlan::getLatestPathWithConfig( { return &paths.back(); } - paths.emplace_back(GCodePath{ .z_offset = z_offset, - .config = config, - .mesh = current_mesh_, - .space_fill_type = space_fill_type, - .flow = flow, - .width_factor = width_factor, - .spiralize = spiralize, - .speed_factor = speed_factor }); + paths.emplace_back( + GCodePath{ .z_offset = z_offset, + .config = config, + .mesh = current_mesh_, + .space_fill_type = space_fill_type, + .flow = flow, + .width_factor = width_factor, + .spiralize = spiralize, + .speed_factor = speed_factor }); GCodePath* ret = &paths.back(); ret->skip_agressive_merge_hint = mode_skip_agressive_merge_; @@ -571,28 +572,29 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( const auto add_extrusion_move = [&](const Point3LL& target, const std::optional speed_region_index = std::nullopt) { const Ratio overhang_speed_factor = speed_region_index.has_value() ? overhang_masks_[speed_region_index.value()].speed_ratio : 1.0_r; + addExtrusionMove(target, config, space_fill_type, flow, width_factor, spiralize, speed_factor * overhang_speed_factor, fan_speed, travel_to_z); + }; - const bool is_overhanging = speed_region_index.has_value() && speed_region_index.value() > 0; - + const auto update_is_overhanging = [this](const Point2LL& target, std::optional current_position, const bool is_overhanging = false) + { if (is_overhanging != currently_overhanging_) { max_overhang_length_ = std::max(current_overhang_length_, max_overhang_length_); current_overhang_length_ = 0; } - if (is_overhanging && last_planned_position_.has_value()) + if (is_overhanging && current_position.has_value()) { - current_overhang_length_ += vSize(target.toPoint2LL() - last_planned_position_.value()); + current_overhang_length_ += vSize(target - current_position.value()); } currently_overhanging_ = is_overhanging; - - addExtrusionMove(target, config, space_fill_type, flow, width_factor, spiralize, speed_factor * overhang_speed_factor, fan_speed, travel_to_z); }; if (overhang_masks_.empty() || ! last_planned_position_.has_value()) { // Unable to apply gradual overhanging (probably just disabled), just add the basic extrusion move + update_is_overhanging(p.toPoint2LL(), last_planned_position_); add_extrusion_move(p); return; } @@ -612,40 +614,12 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( // Pre-calculate the intersections of the segment with all regions (except last one, you cannot intersect an infinite plane) const Point2LL end = p.toPoint2LL(); const Point2LL vector = end - start; - const coord_t segment_length = vSize(vector); std::vector> speed_regions_intersections; speed_regions_intersections.reserve(overhang_masks_.size() - 1); for (const OverhangMask& overhang_region : overhang_masks_ | ranges::views::drop_last(1)) { std::vector intersections = overhang_region.supported_region.intersectionsWithSegment(start, end); ranges::sort(intersections); - - // Avoid microsegments: Move intersections that are too close to the start or end of the segment slightly more to the center of the segment. - for (float& intersection : intersections) - { - if (intersection * segment_length < MINIMUM_LINE_LENGTH) - { - intersection = MINIMUM_LINE_LENGTH / static_cast(segment_length); - } - else if (intersection * segment_length > segment_length - MINIMUM_LINE_LENGTH) - { - intersection = (segment_length - MINIMUM_LINE_LENGTH) / static_cast(segment_length); - } - } - - // (Also) Avoid microsegments: Filter out pairs of intersections that are too close to each other. - // This should be possible because the intersections happen in the same region. - constexpr std::array dummy = { 2.0f }; - std::vector temp_intersections; - for (const auto& tup : ranges::views::concat(dummy, intersections, dummy) | ranges::views::sliding(3)) - { - if (std::abs(tup[1] - tup[0]) * segment_length >= MINIMUM_LINE_LENGTH && std::abs(tup[2] - tup[1]) * segment_length >= MINIMUM_LINE_LENGTH) - { - temp_intersections.push_back(tup[1]); - } - } - intersections = temp_intersections; - speed_regions_intersections.push_back(intersections); } @@ -664,6 +638,14 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( } }; + struct SegmentExtrusionMove + { + Point2LL position; + size_t speed_region_index; + }; + + std::vector extrusion_moves; + // Now move along segment and split it where we cross speed regions while (true) { @@ -701,7 +683,7 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( // Move to intersection at current region speed const Point2LL split_position = start + vector * intersection_parameter; - add_extrusion_move(split_position, actual_speed_region_index); + extrusion_moves.push_back(SegmentExtrusionMove{ split_position, actual_speed_region_index }); // Prepare for next move in different region actual_speed_region_index = next_speed_region_index; @@ -710,9 +692,67 @@ void LayerPlan::addExtrusionMoveWithGradualOverhang( else { // We cross no border, which means we can reach the end of the segment within the current speed region, so we are done - add_extrusion_move(p, actual_speed_region_index); - return; + extrusion_moves.push_back(SegmentExtrusionMove{ p.toPoint2LL(), actual_speed_region_index }); + break; + } + } + + // Filter out micro-segments + std::vector extrusion_moves_filtered; + extrusion_moves_filtered.reserve(extrusion_moves.size()); + Point2LL current_position = start; + for (const SegmentExtrusionMove& extrusion_move : extrusion_moves | ranges::views::drop_last(1)) + { + if (vSize2(extrusion_move.position - current_position) >= MINIMUM_SQUARED_LINE_LENGTH) + { + extrusion_moves_filtered.push_back(extrusion_move); + } + + current_position = extrusion_move.position; + } + + if (extrusion_moves_filtered.empty() || vSize2(extrusion_moves.back().position - current_position) >= MINIMUM_SQUARED_LINE_LENGTH) + { + extrusion_moves_filtered.push_back(extrusion_moves.back()); + } + else + { + extrusion_moves_filtered.back().position = extrusion_moves.back().position; + } + + // Calculate max consecutive overhanging segment length + current_position = start; + for (const SegmentExtrusionMove& extrusion_move : extrusion_moves_filtered) + { + const bool is_overhanging = extrusion_move.speed_region_index > 0; + update_is_overhanging(extrusion_move.position, current_position, is_overhanging); + current_position = extrusion_move.position; + } + + // Merge consecutive sub-segments that in the end have the same speed + std::vector extrusion_moves_merged; + extrusion_moves_merged.reserve(extrusion_moves_filtered.size()); + extrusion_moves_merged.push_back(extrusion_moves_filtered.front()); + + for (const SegmentExtrusionMove& extrusion_move : extrusion_moves_filtered | ranges::views::drop(1)) + { + const Ratio previous_speed_factor = overhang_masks_[extrusion_moves_merged.back().speed_region_index].speed_ratio; + const Ratio next_speed_factor = overhang_masks_[extrusion_move.speed_region_index].speed_ratio; + + if (next_speed_factor == previous_speed_factor) + { + extrusion_moves_merged.back().position = extrusion_move.position; } + else + { + extrusion_moves_merged.push_back(extrusion_move); + } + } + + // Finally, add extrusion moves + for (const SegmentExtrusionMove& extrusion_move : extrusion_moves_merged) + { + add_extrusion_move(extrusion_move.position, extrusion_move.speed_region_index); } } From d1534f58503a04a958eeac38a0a1fdf3d7f927f2 Mon Sep 17 00:00:00 2001 From: wawanbreton <601114+wawanbreton@users.noreply.github.com> Date: Wed, 22 Jan 2025 08:15:25 +0000 Subject: [PATCH 14/14] Apply clang-format --- src/LayerPlan.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index 74cf3794b7..dc73c224ea 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -57,15 +57,14 @@ GCodePath* LayerPlan::getLatestPathWithConfig( { return &paths.back(); } - paths.emplace_back( - GCodePath{ .z_offset = z_offset, - .config = config, - .mesh = current_mesh_, - .space_fill_type = space_fill_type, - .flow = flow, - .width_factor = width_factor, - .spiralize = spiralize, - .speed_factor = speed_factor }); + paths.emplace_back(GCodePath{ .z_offset = z_offset, + .config = config, + .mesh = current_mesh_, + .space_fill_type = space_fill_type, + .flow = flow, + .width_factor = width_factor, + .spiralize = spiralize, + .speed_factor = speed_factor }); GCodePath* ret = &paths.back(); ret->skip_agressive_merge_hint = mode_skip_agressive_merge_;