tweak small perimeter

Signed-off-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
SoftFever 2023-02-09 19:55:53 +08:00
parent a1476784c4
commit b69a9663e1

View file

@ -3358,18 +3358,20 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
loop.clip_end(clip_length, &paths); loop.clip_end(clip_length, &paths);
if (paths.empty()) return ""; if (paths.empty()) return "";
// BBS: remove small small_perimeter_speed config, and will absolutely // SoftFever: check loop lenght for small perimeter.
// remove related code if no other issue in the coming release. double small_peri_speed = -1;
// apply the small perimeter speed if (speed == -1 && loop.length() <= SMALL_PERIMETER_LENGTH(m_config.small_perimeter_threshold.value))
if (is_perimeter(paths.front().role()) && loop.length() <= SMALL_PERIMETER_LENGTH(m_config.small_perimeter_threshold.value) && speed == -1) small_peri_speed = m_config.small_perimeter_speed.get_abs_value(m_config.outer_wall_speed);
speed = m_config.small_perimeter_speed.get_abs_value(m_config.outer_wall_speed);
// extrude along the path // extrude along the path
std::string gcode; std::string gcode;
bool is_small_peri = false;
for (ExtrusionPaths::iterator path = paths.begin(); path != paths.end(); ++path) { for (ExtrusionPaths::iterator path = paths.begin(); path != paths.end(); ++path) {
// description += ExtrusionLoop::role_to_string(loop.loop_role()); // description += ExtrusionLoop::role_to_string(loop.loop_role());
// description += ExtrusionEntity::role_to_string(path->role); // description += ExtrusionEntity::role_to_string(path->role);
gcode += this->_extrude(*path, description, speed); // don't apply small perimeter setting for overhangs/bridges/non-perimeters
is_small_peri = is_perimeter(path->role()) && !is_bridge(path->role()) && small_peri_speed > 0 && (path->get_overhang_degree() == 0 || path->get_overhang_degree() > 5);
gcode += this->_extrude(*path, description, is_small_peri ? small_peri_speed : speed);
} }
//BBS: don't reset acceleration when printing first layer. During first layer, acceleration is always same value. //BBS: don't reset acceleration when printing first layer. During first layer, acceleration is always same value.