|
@@ -570,7 +570,7 @@ void Planner::check_axes_activity() {
|
570
|
570
|
#endif
|
571
|
571
|
}
|
572
|
572
|
|
573
|
|
- void Planner::unapply_leveling(float &lx, float &ly, float &lz) {
|
|
573
|
+ void Planner::unapply_leveling(float logical[XYZ]) {
|
574
|
574
|
|
575
|
575
|
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
|
576
|
576
|
if (!abl_enabled) return;
|
|
@@ -579,26 +579,25 @@ void Planner::check_axes_activity() {
|
579
|
579
|
#if ENABLED(MESH_BED_LEVELING)
|
580
|
580
|
|
581
|
581
|
if (mbl.active())
|
582
|
|
- lz -= mbl.get_z(RAW_X_POSITION(lx), RAW_Y_POSITION(ly));
|
|
582
|
+ logical[Z_AXIS] -= mbl.get_z(RAW_X_POSITION(logical[X_AXIS]), RAW_Y_POSITION(logical[Y_AXIS]));
|
583
|
583
|
|
584
|
584
|
#elif ENABLED(AUTO_BED_LEVELING_LINEAR)
|
585
|
585
|
|
586
|
586
|
matrix_3x3 inverse = matrix_3x3::transpose(bed_level_matrix);
|
587
|
587
|
|
588
|
|
- float dx = RAW_X_POSITION(lx) - (X_TILT_FULCRUM),
|
589
|
|
- dy = RAW_Y_POSITION(ly) - (Y_TILT_FULCRUM),
|
590
|
|
- dz = RAW_Z_POSITION(lz);
|
|
588
|
+ float dx = RAW_X_POSITION(logical[X_AXIS]) - (X_TILT_FULCRUM),
|
|
589
|
+ dy = RAW_Y_POSITION(logical[Y_AXIS]) - (Y_TILT_FULCRUM),
|
|
590
|
+ dz = RAW_Z_POSITION(logical[Z_AXIS]);
|
591
|
591
|
|
592
|
592
|
apply_rotation_xyz(inverse, dx, dy, dz);
|
593
|
593
|
|
594
|
|
- lx = LOGICAL_X_POSITION(dx + X_TILT_FULCRUM);
|
595
|
|
- ly = LOGICAL_Y_POSITION(dy + Y_TILT_FULCRUM);
|
596
|
|
- lz = LOGICAL_Z_POSITION(dz);
|
|
594
|
+ logical[X_AXIS] = LOGICAL_X_POSITION(dx + X_TILT_FULCRUM);
|
|
595
|
+ logical[Y_AXIS] = LOGICAL_Y_POSITION(dy + Y_TILT_FULCRUM);
|
|
596
|
+ logical[Z_AXIS] = LOGICAL_Z_POSITION(dz);
|
597
|
597
|
|
598
|
598
|
#elif ENABLED(AUTO_BED_LEVELING_NONLINEAR)
|
599
|
599
|
|
600
|
|
- float tmp[XYZ] = { lx, ly, 0 };
|
601
|
|
- lz -= nonlinear_z_offset(tmp);
|
|
600
|
+ logical[Z_AXIS] -= nonlinear_z_offset(logical);
|
602
|
601
|
|
603
|
602
|
#endif
|
604
|
603
|
}
|