Fix wrong warning info & revert exceeding boundary (#141)

This commit is contained in:
xiaoyeliu
2026-01-26 23:32:52 +08:00
committed by GitHub
parent cf4275198c
commit a9823f19ea
6 changed files with 463 additions and 513 deletions

View File

@@ -437,10 +437,6 @@ std::string WipeTowerIntegration::append_tcr(GCode& gcodegen, const WipeTower::T
auto transform_wt_pt = [&alpha, this](const Vec2f& pt) -> Vec2f {
Vec2f out = Eigen::Rotation2Df(alpha) * pt;
// Simple safety check to prevent extreme out-of-bounds coordinates
// This is a safety net for Rib wall geometry issues
out.x() = std::clamp(out.x(), -50.f, 500.f);
out.y() = std::clamp(out.y(), -50.f, 500.f);
out += m_wipe_tower_pos;
return out;
};
@@ -701,10 +697,6 @@ std::string WipeTowerIntegration::append_tcr2(GCode& gcodegen, const WipeTower::
auto transform_wt_pt = [&alpha, this](const Vec2f& pt) -> Vec2f {
Vec2f out = Eigen::Rotation2Df(alpha) * pt;
// Simple safety check to prevent extreme out-of-bounds coordinates
// This is a safety net for Rib wall geometry issues
out.x() = std::clamp(out.x(), -50.f, 500.f);
out.y() = std::clamp(out.y(), -50.f, 500.f);
out += m_wipe_tower_pos;
return out;
};

View File

@@ -1237,11 +1237,6 @@ private:
double s = sin(angle);
Vec2f result(float(pt.x() * c - pt.y() * s) + m_wipe_tower_width / 2.f, float(pt.x() * s + pt.y() * c) + m_wipe_tower_depth / 2.f);
// Clamp rotated coordinates to valid range to prevent out-of-bounds positions
// This fixes issues with Rib wall geometry extending beyond expected bounds
result.x() = std::clamp(result.x(), 0.f, m_wipe_tower_width);
result.y() = std::clamp(result.y(), 0.f, m_wipe_tower_depth);
return result;
}
@@ -1969,10 +1964,9 @@ void WipeTower2::toolchange_Wipe(WipeTowerWriter2& writer, const WipeTower::box_
// We may be going back to the model - wipe the nozzle. If this is followed
// by finish_layer, this wipe path will be overwritten.
// Clamp wipe point coordinates to valid range to prevent out-of-bounds positions
float wipe_y = std::clamp(writer.y() - dy, 0.f, m_wipe_tower_depth);
float wipe_x = std::clamp(!m_left_to_right ? m_wipe_tower_width : 0.f, 0.f, m_wipe_tower_width);
writer.add_wipe_point(writer.x(), writer.y()).add_wipe_point(writer.x(), wipe_y).add_wipe_point(wipe_x, wipe_y);
writer.add_wipe_point(writer.x(), writer.y())
.add_wipe_point(writer.x(), writer.y() - dy)
.add_wipe_point(! m_left_to_right ? m_wipe_tower_width : 0.f, writer.y() - dy);
if (m_layer_info != m_plan.end() && m_current_tool != m_layer_info->tool_changes.back().new_tool)
m_left_to_right = !m_left_to_right;

File diff suppressed because it is too large Load Diff

View File

@@ -9706,9 +9706,7 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
break;
// Snapmaker: 螺旋抬升靠近边界警告
case EWarning::SpiralLiftNearBoundary:
text = _u8L("An object is too close to the plate boundary. "
"Spiral lift during printing may exceed the bed and cause a crash. "
"Please move the object away from the edge (recommend keeping at least 3mm distance).");
text = _u8L("Model too close to bed boundary. Disable spiral lifting or keep at least 3.5mm gap to avoid collision.");
error = ErrorType::SLICING_SERIOUS_WARNING;
break;
}