|
|
@ -223,7 +223,16 @@ class unified_bed_leveling {
|
|
|
|
SERIAL_EOL();
|
|
|
|
SERIAL_EOL();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* The requested location is off the mesh. Check if UBL_Z_RAISE_WHEN_OFF_MESH
|
|
|
|
|
|
|
|
* is specified. If so, that value is returned.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if ENABLED(UBL_Z_RAISE_WHEN_OFF_MESH)
|
|
|
|
|
|
|
|
return UBL_Z_RAISE_WHEN_OFF_MESH;
|
|
|
|
|
|
|
|
#else
|
|
|
|
return NAN;
|
|
|
|
return NAN;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0 / (MESH_X_DIST)),
|
|
|
|
const float xratio = (rx0 - mesh_index_to_xpos(x1_i)) * (1.0 / (MESH_X_DIST)),
|
|
|
@ -249,7 +258,16 @@ class unified_bed_leveling {
|
|
|
|
SERIAL_EOL();
|
|
|
|
SERIAL_EOL();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* The requested location is off the mesh. Check if UBL_Z_RAISE_WHEN_OFF_MESH
|
|
|
|
|
|
|
|
* is specified. If so, that value is returned.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if ENABLED(UBL_Z_RAISE_WHEN_OFF_MESH)
|
|
|
|
|
|
|
|
return UBL_Z_RAISE_WHEN_OFF_MESH;
|
|
|
|
|
|
|
|
#else
|
|
|
|
return NAN;
|
|
|
|
return NAN;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0 / (MESH_Y_DIST)),
|
|
|
|
const float yratio = (ry0 - mesh_index_to_ypos(y1_i)) * (1.0 / (MESH_Y_DIST)),
|
|
|
@ -270,6 +288,15 @@ class unified_bed_leveling {
|
|
|
|
const int8_t cx = get_cell_index_x(rx0),
|
|
|
|
const int8_t cx = get_cell_index_x(rx0),
|
|
|
|
cy = get_cell_index_y(ry0); // return values are clamped
|
|
|
|
cy = get_cell_index_y(ry0); // return values are clamped
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Check if the requested location is off the mesh. If so, and
|
|
|
|
|
|
|
|
* UBL_Z_RAISE_WHEN_OFF_MESH is specified, that value is returned.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if ENABLED(UBL_Z_RAISE_WHEN_OFF_MESH)
|
|
|
|
|
|
|
|
if (!WITHIN(rx0, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(ry0, 0, GRID_MAX_POINTS_Y - 1))
|
|
|
|
|
|
|
|
return UBL_Z_RAISE_WHEN_OFF_MESHH;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
const float z1 = calc_z0(rx0,
|
|
|
|
const float z1 = calc_z0(rx0,
|
|
|
|
mesh_index_to_xpos(cx), z_values[cx][cy],
|
|
|
|
mesh_index_to_xpos(cx), z_values[cx][cy],
|
|
|
|
mesh_index_to_xpos(cx + 1), z_values[min(cx, GRID_MAX_POINTS_X - 2) + 1][cy]);
|
|
|
|
mesh_index_to_xpos(cx + 1), z_values[min(cx, GRID_MAX_POINTS_X - 2) + 1][cy]);
|
|
|
|