ENH: do not reverse wipe for supports

This might help improve the quality and strength of supports.

jira: STUDIO-11985
Change-Id: I51644c84b9ede018a08a0f2b8fdca5d271d69991
(cherry picked from commit ba5dbc544b65276d772834305fcca6b5f7536d6e)
This commit is contained in:
Arthur 2025-04-24 17:27:51 +08:00 committed by Noisyfox
parent 0f08d28556
commit b965d420cf

View file

@ -5480,8 +5480,20 @@ std::string GCode::extrude_path(ExtrusionPath path, std::string description, dou
// description += ExtrusionEntity::role_to_string(path.role());
std::string gcode = this->_extrude(path, description, speed);
if (m_wipe.enable && FILAMENT_CONFIG(wipe)) {
m_wipe.path = std::move(path.polyline);
m_wipe.path.reverse();
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();
}
return gcode;