Add warning info on spirail lift before slicing

This commit is contained in:
xiaoyeliu
2026-01-24 14:09:42 +08:00
parent b8bf1a8fe1
commit cf4275198c
7 changed files with 339 additions and 1 deletions

View File

@@ -2823,6 +2823,13 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
if (printer_technology != ptSLA || !contained_min_one)
_set_warning_notification(EWarning::SlaSupportsOutside, false);
// Snapmaker: 螺旋抬升边界警告 - 无论模型是否超出边界都检测
if (contained_min_one) {
_set_warning_notification(EWarning::SpiralLiftNearBoundary, _is_any_volume_near_boundary_for_spiral_lift());
} else {
_set_warning_notification(EWarning::SpiralLiftNearBoundary, false);
}
post_event(Event<bool>(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS,
contained_min_one && !m_model->objects.empty() && !partlyOut));
}
@@ -2830,6 +2837,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
_set_warning_notification(EWarning::ObjectOutside, false);
_set_warning_notification(EWarning::ObjectClashed, false);
_set_warning_notification(EWarning::SlaSupportsOutside, false);
_set_warning_notification(EWarning::SpiralLiftNearBoundary, false); // Snapmaker: 清空警告
post_event(Event<bool>(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS, false));
}
}
@@ -9696,6 +9704,13 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
"Please solve the problem by moving it totally on or off the plate, and confirming that the height is within the build volume.");
error = ErrorType::PLATER_ERROR;
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).");
error = ErrorType::SLICING_SERIOUS_WARNING;
break;
}
//BBS: this may happened when exit the app, plater is null
if (!wxGetApp().plater())
@@ -9750,6 +9765,12 @@ bool GLCanvas3D::_is_any_volume_outside() const
return false;
}
// Snapmaker: 检查是否有任何 volume 靠近边界(螺旋抬升风险)
bool GLCanvas3D::_is_any_volume_near_boundary_for_spiral_lift() const
{
return m_volumes.is_any_volume_near_boundary_for_spiral_lift();
}
void GLCanvas3D::_update_selection_from_hover()
{
bool ctrl_pressed = wxGetKeyState(WXK_CONTROL);