ENH: do not reverse wipe for supports

This might help improve the quality and strength of supports.

jira: STUDIO-11985
Change-Id: I51644c84b9ede018a08a0f2b8fdca5d271d69991
This commit is contained in:
Arthur 2025-04-24 17:27:51 +08:00 committed by lane.wei
parent fda752bb79
commit ba5dbc544b

View File

@ -4944,7 +4944,19 @@ std::string GCode::extrude_path(ExtrusionPath path, std::string description, dou
bool flag = path.get_customize_flag() == CustomizeFlag::cfFloatingVerticalShell; bool flag = path.get_customize_flag() == CustomizeFlag::cfFloatingVerticalShell;
std::string gcode = this->_extrude(path, description, speed,flag); std::string gcode = this->_extrude(path, description, speed,flag);
if (m_wipe.enable && FILAMENT_CONFIG(wipe)) { if (m_wipe.enable && FILAMENT_CONFIG(wipe)) {
m_wipe.path = std::move(path.polyline); m_wipe.path = path.polyline;
if (is_tree(this->config().support_type) && (path.role() == erSupportMaterial || path.role() == erSupportMaterialInterface || path.role() == erSupportTransition)) {
if ((m_wipe.path.first_point() - m_wipe.path.last_point()).cast<double>().norm() > scale_(0.2)) {
double min_dist = scale_(0.2);
int i = 0;
for (; i < path.polyline.points.size(); i++) {
double dist = (path.polyline.points[i] - path.last_point()).cast<double>().norm();
if (dist < min_dist) min_dist = dist;
if (min_dist < scale_(0.2) && dist > min_dist) break;
}
m_wipe.path = Polyline(Points(path.polyline.points.begin() + i - 1, path.polyline.points.end()));
}
} else
m_wipe.path.reverse(); m_wipe.path.reverse();
} }
//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.