0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-19 08:08:25 +00:00

🐛 Fix UBL probe_entire_mesh skips points (#26141)

Fixes #26132
This commit is contained in:
Miguel Risco-Castillo 2023-08-07 16:11:12 -05:00 committed by GitHub
parent ca0209b868
commit 88f5e2c639
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -786,14 +786,18 @@ void unified_bed_leveling::shift_mesh_height() {
} }
#endif #endif
best = do_furthest #ifndef HUGE_VALF
#define HUGE_VALF (10e100F)
#endif
best = do_furthest // Points with valid data or HUGE_VALF are skipped
? find_furthest_invalid_mesh_point() ? find_furthest_invalid_mesh_point()
: find_closest_mesh_point_of_type(INVALID, nearby, true); : find_closest_mesh_point_of_type(INVALID, nearby, true);
if (best.pos.x >= 0) { // mesh point found and is reachable by probe if (best.pos.x >= 0) { // mesh point found and is reachable by probe
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::G29_POINT_START)); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::G29_POINT_START));
const float measured_z = probe.probe_at_point(best.meshpos(), stow_probe ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); const float measured_z = probe.probe_at_point(best.meshpos(), stow_probe ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity);
z_values[best.pos.x][best.pos.y] = measured_z; z_values[best.pos.x][best.pos.y] = isnan(measured_z) ? HUGE_VALF : measured_z; // Mark invalid point already probed with HUGE_VALF to omit it in the next loop
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
ExtUI::onMeshUpdate(best.pos, ExtUI::G29_POINT_FINISH); ExtUI::onMeshUpdate(best.pos, ExtUI::G29_POINT_FINISH);
ExtUI::onMeshUpdate(best.pos, measured_z); ExtUI::onMeshUpdate(best.pos, measured_z);
@ -803,6 +807,8 @@ void unified_bed_leveling::shift_mesh_height() {
} while (best.pos.x >= 0 && --count); } while (best.pos.x >= 0 && --count);
GRID_LOOP(x, y) if (z_values[x][y] == HUGE_VALF) z_values[x][y] = NAN; // Restore NAN for HUGE_VALF marks
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::G29_FINISH)); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::G29_FINISH));
// Release UI during stow to allow for PAUSE_BEFORE_DEPLOY_STOW // Release UI during stow to allow for PAUSE_BEFORE_DEPLOY_STOW