Made this as an option in the GUI

This commit is contained in:
igiannakas 2023-09-12 11:13:33 +01:00
parent 8a7c6a297a
commit 7d14ac9e03
8 changed files with 84 additions and 33 deletions

View file

@ -268,11 +268,14 @@ public:
const ConfigOptionPercents &overlaps,
const ConfigOptionFloatsOrPercents &speeds,
float ext_perimeter_speed,
float original_speed)
float original_speed,
bool slowdown_for_curled_edges)
{
size_t speed_sections_count = std::min(overlaps.values.size(), speeds.values.size());
std::vector<std::pair<float, float>> speed_sections;
for (size_t i = 0; i < speed_sections_count; i++) {
float distance = path.width * (1.0 - (overlaps.get_at(i) / 100.0));
float speed = speeds.get_at(i).percent ? (ext_perimeter_speed * speeds.get_at(i).value / 100.0) : speeds.get_at(i).value;
@ -371,8 +374,10 @@ public:
};
float extrusion_speed = std::min(calculate_speed(curr.distance), calculate_speed(next.distance));
float curled_speed = calculate_speed(artificial_distance_to_curled_lines);
extrusion_speed = std::min(curled_speed, extrusion_speed); // adjust extrusion speed based on what is smallest - the calculated overhang speed or the artificial curled speed
if(slowdown_for_curled_edges) {
float curled_speed = calculate_speed(artificial_distance_to_curled_lines);
extrusion_speed = std::min(curled_speed, extrusion_speed); // adjust extrusion speed based on what is smallest - the calculated overhang speed or the artificial curled speed
}
float overlap = std::min(1 - curr.distance * width_inv, 1 - next.distance * width_inv);