|
@@ -7860,18 +7860,22 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_
|
7860
|
7860
|
|
7861
|
7861
|
#define MBL_SEGMENT_END(A) (current_position[A ##_AXIS] + (destination[A ##_AXIS] - current_position[A ##_AXIS]) * normalized_dist)
|
7862
|
7862
|
|
7863
|
|
- float nx, ny, normalized_dist;
|
|
7863
|
+ float normalized_dist, end[NUM_AXIS];
|
|
7864
|
+
|
|
7865
|
+ // Split at the left/front border of the right/top square
|
7864
|
7866
|
int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2);
|
7865
|
7867
|
if (cx2 != cx1 && TEST(x_splits, gcx)) {
|
7866
|
|
- nx = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS];
|
7867
|
|
- normalized_dist = (nx - current_position[X_AXIS]) / (destination[X_AXIS] - current_position[X_AXIS]);
|
7868
|
|
- ny = MBL_SEGMENT_END(Y);
|
|
7868
|
+ memcpy(end, destination, sizeof(end));
|
|
7869
|
+ destination[X_AXIS] = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS];
|
|
7870
|
+ normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]);
|
|
7871
|
+ destination[Y_AXIS] = MBL_SEGMENT_END(Y);
|
7869
|
7872
|
CBI(x_splits, gcx);
|
7870
|
7873
|
}
|
7871
|
7874
|
else if (cy2 != cy1 && TEST(y_splits, gcy)) {
|
7872
|
|
- ny = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS];
|
7873
|
|
- normalized_dist = (ny - current_position[Y_AXIS]) / (destination[Y_AXIS] - current_position[Y_AXIS]);
|
7874
|
|
- nx = MBL_SEGMENT_END(X);
|
|
7875
|
+ memcpy(end, destination, sizeof(end));
|
|
7876
|
+ destination[Y_AXIS] = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS];
|
|
7877
|
+ normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]);
|
|
7878
|
+ destination[X_AXIS] = MBL_SEGMENT_END(X);
|
7875
|
7879
|
CBI(y_splits, gcy);
|
7876
|
7880
|
}
|
7877
|
7881
|
else {
|
|
@@ -7881,12 +7885,6 @@ void mesh_line_to_destination(float fr_mm_m, uint8_t x_splits = 0xff, uint8_t y_
|
7881
|
7885
|
return;
|
7882
|
7886
|
}
|
7883
|
7887
|
|
7884
|
|
- // Save given destination for after recursion
|
7885
|
|
- float end[NUM_AXIS];
|
7886
|
|
- memcpy(end, destination, sizeof(end));
|
7887
|
|
-
|
7888
|
|
- destination[X_AXIS] = nx;
|
7889
|
|
- destination[Y_AXIS] = ny;
|
7890
|
7888
|
destination[Z_AXIS] = MBL_SEGMENT_END(Z);
|
7891
|
7889
|
destination[E_AXIS] = MBL_SEGMENT_END(E);
|
7892
|
7890
|
|