|
@@ -160,7 +160,8 @@
|
160
|
160
|
unified_bed_leveling();
|
161
|
161
|
|
162
|
162
|
FORCE_INLINE void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; }
|
163
|
|
- int8_t get_cell_index_x(const float &x) {
|
|
163
|
+
|
|
164
|
+ int8_t get_cell_index_x(const float &x) {
|
164
|
165
|
const int8_t cx = (x - (UBL_MESH_MIN_X)) * (1.0 / (MESH_X_DIST));
|
165
|
166
|
return constrain(cx, 0, (GRID_MAX_POINTS_X) - 1); // -1 is appropriate if we want all movement to the X_MAX
|
166
|
167
|
} // position. But with this defined this way, it is possible
|
|
@@ -210,7 +211,8 @@
|
210
|
211
|
*/
|
211
|
212
|
inline float z_correction_for_x_on_horizontal_mesh_line(const float &lx0, const int x1_i, const int yi) {
|
212
|
213
|
if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) {
|
213
|
|
- SERIAL_ECHOPAIR("? in z_correction_for_x_on_horizontal_mesh_line(lx0=", lx0);
|
|
214
|
+ serialprintPGM( !WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) ? PSTR("x1l_i") : PSTR("yi") );
|
|
215
|
+ SERIAL_ECHOPAIR(" out of bounds in z_correction_for_x_on_horizontal_mesh_line(lx0=", lx0);
|
214
|
216
|
SERIAL_ECHOPAIR(",x1_i=", x1_i);
|
215
|
217
|
SERIAL_ECHOPAIR(",yi=", yi);
|
216
|
218
|
SERIAL_CHAR(')');
|
|
@@ -229,9 +231,10 @@
|
229
|
231
|
//
|
230
|
232
|
inline float z_correction_for_y_on_vertical_mesh_line(const float &ly0, const int xi, const int y1_i) {
|
231
|
233
|
if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) {
|
232
|
|
- SERIAL_ECHOPAIR("? in get_z_correction_along_vertical_mesh_line_at_specific_x(ly0=", ly0);
|
233
|
|
- SERIAL_ECHOPAIR(", x1_i=", xi);
|
234
|
|
- SERIAL_ECHOPAIR(", yi=", y1_i);
|
|
234
|
+ serialprintPGM( !WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) ? PSTR("xi") : PSTR("yl_i") );
|
|
235
|
+ SERIAL_ECHOPAIR(" out of bounds in z_correction_for_y_on_vertical_mesh_line(ly0=", ly0);
|
|
236
|
+ SERIAL_ECHOPAIR(", xi=", xi);
|
|
237
|
+ SERIAL_ECHOPAIR(", y1_i=", y1_i);
|
235
|
238
|
SERIAL_CHAR(')');
|
236
|
239
|
SERIAL_EOL;
|
237
|
240
|
return NAN;
|